{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/revel-digital-gadget-definition-file/latest.json",
  "title": "gadget.yaml",
  "description": "Schema for Revel Digital gadget.yaml files. See <https://developer.reveldigital.com/gadgets> for more information.",
  "x-lintel": {
    "source": "https://www.schemastore.org/gadget-yaml.json",
    "sourceSha256": "cc2366c0d8a9f7057a55ea838fe9acf2c24e4587bbeef60633b176cd602ab839",
    "fileMatch": [
      "gadget.yml",
      "gadget.yaml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "title": {
      "type": "string"
    },
    "title_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "description": {
      "type": "string"
    },
    "author": {
      "type": "string"
    },
    "background": {
      "type": "string"
    },
    "requirements": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "locales": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Locale"
      }
    },
    "prefs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Pref"
      }
    }
  },
  "$defs": {
    "Locale": {
      "type": "object",
      "title": "Locale",
      "properties": {
        "messages": {
          "type": "string",
          "format": "uri"
        },
        "lang": {
          "type": "string"
        }
      },
      "required": [
        "messages"
      ],
      "additionalProperties": false
    },
    "Pref": {
      "type": "object",
      "title": "Pref",
      "properties": {
        "name": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "datatype": {
          "type": "string"
        },
        "default_value": {
          "$ref": "#/$defs/DefaultValue"
        },
        "required": {
          "type": "boolean"
        },
        "options": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Option"
          }
        },
        "depends": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Depend"
          }
        },
        "multiple": {
          "type": "boolean"
        },
        "multiline": {
          "type": "boolean"
        }
      },
      "required": [
        "datatype",
        "default_value",
        "display_name",
        "name",
        "required"
      ],
      "additionalProperties": false
    },
    "Depend": {
      "type": "object",
      "title": "Depend",
      "properties": {
        "name": {
          "type": "string"
        },
        "any_of": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AnyOf"
          }
        },
        "all_of": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AllOf"
          }
        },
        "none_of": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/NoneOf"
          }
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "AnyOf": {
      "type": "object",
      "title": "AnyOf",
      "properties": {
        "values": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "values"
      ],
      "additionalProperties": false
    },
    "AllOf": {
      "type": "object",
      "title": "AllOf",
      "properties": {
        "values": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "values"
      ],
      "additionalProperties": false
    },
    "NoneOf": {
      "type": "object",
      "title": "NoneOf",
      "properties": {
        "values": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "values"
      ],
      "additionalProperties": false
    },
    "Option": {
      "type": "object",
      "title": "Option",
      "properties": {
        "display_value": {
          "type": "string"
        },
        "value": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "display_value"
      ],
      "additionalProperties": false
    },
    "DefaultValue": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "number"
        },
        {
          "type": "null"
        },
        {
          "type": "string"
        }
      ],
      "title": "DefaultValue"
    }
  },
  "additionalProperties": false,
  "required": [
    "author",
    "background",
    "description",
    "locales",
    "prefs",
    "requirements",
    "title",
    "title_url"
  ]
}
