{
  "$comment": "TODO: Subdivide the schema to have a common definition for each data (spellss, books, creatures)",
  "definitions": {},
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://example.com/object1678401116.json",
  "title": "Root",
  "type": "object",
  "required": ["spells"],
  "properties": {
    "spells": {
      "$id": "#root/spells",
      "title": "spells",
      "type": "array",
      "default": [],
      "items": {
        "$id": "#root/spells/items",
        "title": "Items",
        "type": "object",
        "required": [
          "recid",
          "name",
          "source",
          "page",
          "fateforge_exclusive",
          "level",
          "school",
          "time",
          "range",
          "components",
          "duration",
          "desc"
        ],
        "properties": {
          "recid": {
            "$id": "#root/spells/items/recid",
            "title": "Recid",
            "type": "integer",
            "examples": [0],
            "default": 0,
            "description": "unique id for the spells, for localization purpose",
            "uniqueItems": true,
            "autoIncrement": true
          },
          "name": {
            "$id": "#root/spells/items/name",
            "title": "Name",
            "type": "string",
            "default": "",
            "examples": ["Acid Arrow"],
            "pattern": "^.*$"
          },
          "source": {
            "$id": "#root/spells/items/source",
            "title": "Source",
            "description": "what's the source. Each enum is a book code",
            "type": "string",
            "default": "GRI01",
            "enum": ["GRI01", "ENC01", "CRE01", "GRI02", "ENC02", "CRE02"],
            "examples": ["GRI01"],
            "pattern": "^.*$"
          },
          "page": {
            "$id": "#root/spells/items/page",
            "description": "in the book, page source",
            "title": "Page",
            "type": "integer",
            "examples": [110],
            "default": 0
          },
          "fateforge_exclusive": {
            "$id": "#root/spells/items/fateforge_exclusive",
            "description": "is srd or a creation",
            "title": "fateforge_exclusive",
            "type": "boolean",
            "examples": [true],
            "default": true
          },
          "level": {
            "$id": "#root/spells/items/level",
            "title": "Level",
            "type": "integer",
            "examples": [2],
            "default": 0
          },
          "school": {
            "$id": "#root/spells/items/school",
            "description": " 'A' : Abjuration,'C' : Conjuration, 'D': Divination, 'E': Enchantment, 'N': Necromancy, 'T' : Transmutation, 'I' : Illusion, 'V' : Evocation",
            "enum": ["A", "C", "D", "E", "I", "N", "T", "V"],
            "title": "School",
            "type": "string",
            "examples": ["E"],
            "pattern": "^.*$"
          },
          "time": {
            "$id": "#root/spells/items/time",
            "title": "Time",
            "type": "array",
            "default": [],
            "items": {
              "$id": "#root/spells/items/time/items",
              "title": "Items",
              "type": "object",
              "required": ["number", "unit"],
              "properties": {
                "number": {
                  "$id": "#root/spells/items/time/items/number",
                  "title": "Number",
                  "type": "integer",
                  "examples": [1],
                  "default": 0
                },
                "unit": {
                  "$id": "#root/spells/items/time/items/unit",
                  "title": "Unit",
                  "type": "string",
                  "default": "",
                  "examples": ["action"],
                  "pattern": "^.*$"
                }
              },
              "dependentRequired": {
                "number": ["unit"]
              }
            }
          },
          "range": {
            "$id": "#root/spells/items/range",
            "title": "Range",
            "type": "string"
          },
          "components": {
            "$id": "#root/spells/items/components",
            "title": "Components",
            "type": "object",
            "properties": {
              "v": {
                "$id": "#root/spells/items/components/v",
                "title": "V",
                "type": "boolean",
                "examples": [true],
                "default": true
              },
              "s": {
                "$id": "#root/spells/items/components/s",
                "title": "S",
                "type": "boolean",
                "examples": [true],
                "default": true
              },
              "m": {
                "$id": "#root/spells/items/components/m",
                "title": "M",
                "type": "string",
                "default": "",
                "examples": ["powdered rhubarb leaf and an adder’s stomach"],
                "pattern": "^.*$"
              }
            }
          },
          "duration": {
            "$id": "#root/spells/items/duration",
            "title": "Duration",
            "type": "array",
            "default": [],
            "items": {
              "$id": "#root/spells/items/duration/items",
              "title": "Items",
              "type": "object",
              "required": ["type"],
              "properties": {
                "type": {
                  "$id": "#root/spells/items/duration/items/type",
                  "title": "Type",
                  "type": "string",
                  "enum": ["timed", "permanent", "special", "instant"],
                  "default": "",
                  "examples": ["instant"],
                  "pattern": "^.*$"
                }
              }
            }
          },
          "concentration": {
            "$id": "#root/spells/items/concentration",
            "title": "Concentration",
            "type": "boolean",
            "default": false
          },
          "desc": {
            "$id": "#root/spells/items/desc",
            "title": "Desc",
            "type": "array",
            "default": [],
            "items": {
              "$id": "#root/spells/items/desc/items",
              "title": "Items",
              "type": "string",
              "description": "A description for the entry. Do not copy-paste gameplay infos to prevent copyright",
              "default": "",
              "examples": [
                "A shimmering green arrow streaks toward a target within range and bursts in a spray of acid."
              ],
              "pattern": "^.*$"
            }
          },
          "damageInflict": {
            "$id": "#root/spells/items/damageInflict",
            "title": "Damageinflict",
            "type": "array",
            "default": [],
            "items": {
              "$id": "#root/spells/items/damageInflict/items",
              "title": "Items",
              "type": "string",
              "default": "",
              "examples": ["acid"],
              "pattern": "^.*$"
            }
          },
          "savingThrow": {
            "$id": "#root/spells/items/savingThrow",
            "title": "Savingthrow",
            "description": "array of saving Throw available",
            "type": "array",
            "default": [],
            "items": {
              "$id": "#root/spells/items/savingThrow/items",
              "title": "Items",
              "type": "string",
              "default": "",
              "enum": ["Dex", "Str", "Sag", "Cha", "Int", "Con"],
              "examples": [""],
              "pattern": "^.*$",
              "minItems": 1,
              "uniqueItems": true
            }
          },
          "miscTags": {
            "$id": "#root/spells/items/miscTags",
            "title": "Misctags",
            "type": "array",
            "default": [],
            "items": {
              "$id": "#root/spells/items/miscTags/items",
              "title": "Items",
              "type": "string",
              "default": "",
              "examples": [""],
              "pattern": "^.*$"
            }
          },
          "areaTags": {
            "$id": "#root/spells/items/areaTags",
            "title": "Areatags",
            "type": "array",
            "default": [],
            "items": {
              "$id": "#root/spells/items/areaTags/items",
              "title": "Items",
              "type": "string",
              "default": "",
              "examples": [""],
              "pattern": "^.*$"
            }
          }
        }
      }
    }
  }
}
