{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Dialogue Definitions",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "dialogues"],
  "properties": {
    "schemaVersion": {
      "type": "integer",
      "minimum": 1
    },
    "dialogues": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "name", "description", "dialogueNodes"],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string"
          },
          "dialogueNodes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": ["id", "conditions", "reactions", "choices", "order"],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "conditions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": ["text", "conditionType", "conditionValue", "conditionStepId", "conditionNot", "nextId"],
                    "properties": {
                      "text": {
                        "type": "string"
                      },
                      "conditionType": {
                        "type": "string"
                      },
                      "conditionValue": {
                        "type": "string"
                      },
                      "conditionStepId": {
                        "type": "string"
                      },
                      "conditionNot": {
                        "type": "boolean"
                      },
                      "nextId": {
                        "type": "string"
                      }
                    }
                  }
                },
                "reactions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": ["reactionType", "reactionValue"],
                    "properties": {
                      "reactionType": {
                        "type": "string"
                      },
                      "reactionValue": {
                        "type": "string"
                      }
                    }
                  }
                },
                "choices": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": ["text", "nextId", "conditionType", "conditionValue", "conditionStepId", "conditionNot", "reactionType", "reactionValue"],
                    "properties": {
                      "text": {
                        "type": "string"
                      },
                      "nextId": {
                        "type": "string"
                      },
                      "conditionType": {
                        "type": "string"
                      },
                      "conditionValue": {
                        "type": "string"
                      },
                      "conditionStepId": {
                        "type": "string"
                      },
                      "conditionNot": {
                        "type": "boolean"
                      },
                      "reactionType": {
                        "type": "string"
                      },
                      "reactionValue": {
                        "type": "string"
                      }
                    }
                  }
                },
                "order": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          }
        }
      }
    }
  }
}
