Add references to schema
This commit is contained in:
parent
6c20d6fa64
commit
da5cca1f78
1 changed files with 87 additions and 48 deletions
|
@ -1,38 +1,65 @@
|
|||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"id": "https://toastielab.dev/Emotions-stuff/SupportChild/raw/branch/main/Interviews/interview_template.schema.json",
|
||||
"id": "https://toastielab.dev/toastie-stuff/SupportChild/raw/branch/main/Interviews/interview_template.schema.json",
|
||||
"title": "Interview Template",
|
||||
"description": "An interview dialog tree template for SupportBoi",
|
||||
"definitions":
|
||||
{
|
||||
"step":
|
||||
{
|
||||
"description": "An interview dialog tree template for SupportChild",
|
||||
"definitions": {
|
||||
"reference": {
|
||||
"type": "object",
|
||||
"title": "Interview Step",
|
||||
"description": "Contains a reference to a step defined in the 'definitions' property. You can also specify a button-style and selector-description here to override the one from the referenced step.",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"title": "Definition ID",
|
||||
"description": "The name of the step in 'definitions' to reference.",
|
||||
"minLength": 1
|
||||
},
|
||||
"button-style": {
|
||||
"type": "string",
|
||||
"title": "Button Style",
|
||||
"description": "The style of the button that leads to this step. Requires that the parent step is a 'BUTTONS' step.",
|
||||
"enum": [
|
||||
"PRIMARY",
|
||||
"SECONDARY",
|
||||
"SUCCESS",
|
||||
"DANGER"
|
||||
]
|
||||
},
|
||||
"selector-description": {
|
||||
"type": "string",
|
||||
"title": "Selector Description",
|
||||
"description": "Description for this option in the parent step's selection box. Requires that the parent step is a 'TEXT_SELECTOR'.",
|
||||
"minLength": 1
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"unevaluatedProperties": false
|
||||
},
|
||||
"step": {
|
||||
"type": "object",
|
||||
"title": "Interview Step",
|
||||
"description": "Contains a question, error message or end of an interview.",
|
||||
"properties":
|
||||
{
|
||||
"heading":
|
||||
{
|
||||
"properties": {
|
||||
"heading": {
|
||||
"type": "string",
|
||||
"title": "Heading",
|
||||
"description": "The title of the message.",
|
||||
"minLength": 1
|
||||
},
|
||||
"message":
|
||||
{
|
||||
"message": {
|
||||
"type": "string",
|
||||
"title": "Message",
|
||||
"description": "The text in the embed message that will be sent to the user when they reach this step.",
|
||||
"minLength": 1
|
||||
},
|
||||
"message-type":
|
||||
{
|
||||
"message-type": {
|
||||
"type": "string",
|
||||
"title": "Message Type",
|
||||
"description": "The type of message, decides what the bot will do when the user gets to this step.",
|
||||
"enum":
|
||||
[
|
||||
"enum": [
|
||||
"ERROR",
|
||||
"END_WITH_SUMMARY",
|
||||
"END_WITHOUT_SUMMARY",
|
||||
|
@ -45,13 +72,11 @@
|
|||
"TEXT_INPUT"
|
||||
]
|
||||
},
|
||||
"color":
|
||||
{
|
||||
"color": {
|
||||
"type": "string",
|
||||
"title": "Color",
|
||||
"description": "Colour of the message embed. You can either enter a colour name or a hexadecimal RGB value.",
|
||||
"examples":
|
||||
[
|
||||
"examples": [
|
||||
"BLACK",
|
||||
"WHITE",
|
||||
"GRAY",
|
||||
|
@ -97,86 +122,100 @@
|
|||
],
|
||||
"minLength": 1
|
||||
},
|
||||
"steps":
|
||||
{
|
||||
"step-references": {
|
||||
"type": "object",
|
||||
"title": "Step References",
|
||||
"description": "Similar to the 'steps' property, but references steps from the 'definitions' property instead of defining new ones. The name of the reference is used as a regex match against the user's answer, except for selection boxes and buttons where each step becomes a button or selection option.",
|
||||
"patternProperties": {
|
||||
".*": {
|
||||
"$ref": "#/definitions/reference"
|
||||
}
|
||||
}
|
||||
},
|
||||
"steps": {
|
||||
"type": "object",
|
||||
"title": "Steps",
|
||||
"description": "One or more interview steps. The name of the step is used as a regex match against the user's answer, except for selection boxes and buttons where each step becomes a button or selection option.",
|
||||
"patternProperties":
|
||||
{
|
||||
".*":
|
||||
{
|
||||
"patternProperties": {
|
||||
".*": {
|
||||
"$ref": "#/definitions/step"
|
||||
}
|
||||
}
|
||||
},
|
||||
"summary-field":
|
||||
{
|
||||
"summary-field": {
|
||||
"type": "string",
|
||||
"title": "Summary Field",
|
||||
"description": "When an interview ends all previous answers with this property will be put in a summary. If this property is not specified the answer will not be shown in the summary. The value of this property is the name which will be displayed next to the answer in the summary.",
|
||||
"minLength": 1
|
||||
},
|
||||
"button-style":
|
||||
{
|
||||
"button-style": {
|
||||
"type": "string",
|
||||
"title": "Button Style",
|
||||
"description": "The style of the button that leads to this step. Requires that the parent step is a 'BUTTONS' step.",
|
||||
"enum":
|
||||
[
|
||||
"enum": [
|
||||
"PRIMARY",
|
||||
"SECONDARY",
|
||||
"SUCCESS",
|
||||
"DANGER"
|
||||
]
|
||||
},
|
||||
"selector-description":
|
||||
{
|
||||
"selector-description": {
|
||||
"type": "string",
|
||||
"title": "Selector Description",
|
||||
"description": "Description for this option in the parent step's selection box. Requires that the parent step is a 'TEXT_SELECTOR'.",
|
||||
"minLength": 1
|
||||
},
|
||||
"selector-placeholder":
|
||||
{
|
||||
"selector-placeholder": {
|
||||
"type": "string",
|
||||
"title": "Selector Placeholder",
|
||||
"description": "The placeholder text shown before a value is selected in the selection box. Requires that this step is a TEXT_SELECTOR.",
|
||||
"minLength": 1
|
||||
},
|
||||
"max-length":
|
||||
{
|
||||
"max-length": {
|
||||
"type": "number",
|
||||
"title": "Max Length",
|
||||
"description": "The maximum length of the user's response message. Requires that this step is a 'TEXT_INPUT'.",
|
||||
"maximum": 1024
|
||||
},
|
||||
"min-length":
|
||||
{
|
||||
"min-length": {
|
||||
"type": "number",
|
||||
"title": "Min Length",
|
||||
"description": "The minimum length of the user's response message. Requires that this step is a 'TEXT_INPUT'.",
|
||||
"minimum": 0
|
||||
}
|
||||
},
|
||||
"required": [ "message", "message-type", "color" ],
|
||||
"required": [
|
||||
"message",
|
||||
"message-type",
|
||||
"color"
|
||||
],
|
||||
"unevaluatedProperties": false
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"properties":
|
||||
{
|
||||
"category-id":
|
||||
{
|
||||
"properties": {
|
||||
"category-id": {
|
||||
"type": "number",
|
||||
"title": "Category ID",
|
||||
"description": "The id of the category this template applies to. You can change this and re-upload the template to apply it to a different category."
|
||||
},
|
||||
"interview":
|
||||
{
|
||||
"interview": {
|
||||
"$ref": "#/definitions/step"
|
||||
},
|
||||
"definitions": {
|
||||
"type": "object",
|
||||
"title": "References",
|
||||
"description": "A list of steps that can be referenced from other interview steps. The name of the step is the name to use when referring to this step in the interview.",
|
||||
"patternProperties": {
|
||||
".*": {
|
||||
"$ref": "#/definitions/step"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [ "category-id", "interview" ],
|
||||
"required": [
|
||||
"category-id",
|
||||
"interview"
|
||||
],
|
||||
"unevaluatedProperties": false
|
||||
}
|
Loading…
Add table
Reference in a new issue