{
  "$id": "https://json.schemastore.org/jovo-language-model",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "dialogflowEntity": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "isOverridable": {
          "type": "boolean"
        },
        "isEnum": {
          "type": "boolean"
        },
        "automatedExpansion": {
          "type": "boolean"
        },
        "isList": {
          "type": "boolean"
        }
      }
    }
  },
  "description": "JSON Schema for Jovo language Models (https://www.jovo.tech/docs/model)",
  "properties": {
    "invocation": {
      "type": "string"
    },
    "intents": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["name", "phrases"],
        "properties": {
          "name": {
            "type": "string"
          },
          "phrases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dialogflow": {
            "type": "object",
            "properties": {
              "priority": {
                "type": "number"
              },
              "webhookForSlotFilling": {
                "type": "boolean"
              }
            }
          },
          "inputs": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["name", "type"],
              "properties": {
                "name": {
                  "type": "string"
                },
                "type": {
                  "type": ["string", "object"],
                  "properties": {
                    "alexa": {
                      "type": "string"
                    },
                    "dialogflow": {
                      "type": "string"
                    }
                  }
                },
                "dialogflow": {
                  "$ref": "#/definitions/dialogflowEntity"
                }
              }
            }
          }
        }
      }
    },
    "inputTypes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["name"],
        "properties": {
          "name": {
            "type": "string"
          },
          "dialogflow": {
            "type": "object",
            "properties": {
              "automatedExpansion": {
                "type": "boolean"
              }
            }
          },
          "values": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["value"],
              "properties": {
                "value": {
                  "type": "string"
                },
                "synonyms": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "alexa": {
      "type": "object",
      "properties": {
        "interactionModel": {
          "type": "object",
          "properties": {
            "languageModel": {
              "type": "object",
              "properties": {
                "intents": {
                  "type": "array",
                  "items": {
                    "required": ["name", "samples"],
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "samples": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "dialogflow": {
      "type": "object",
      "properties": {
        "intents": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["name"],
            "properties": {
              "name": {
                "type": "string"
              },
              "auto": {
                "type": "boolean"
              },
              "webhookUsed": {
                "type": "boolean"
              },
              "fallbackIntent": {
                "type": "boolean"
              },
              "events": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": ["name"],
                  "properties": {
                    "name": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "entities": {
          "type": "array",
          "items": {
            "allOf": [
              {
                "$ref": "#/definitions/dialogflowEntity"
              },
              {
                "type": "object",
                "required": ["name"]
              }
            ]
          }
        }
      }
    }
  },
  "required": ["invocation"],
  "title": "JSON Schema for Jovo language Models",
  "type": "object"
}
