{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://redbook.fun/specification/1.0/schemas/model.schema.json",
  "type": "object",
  "properties": {
    "formatVersion": {
      "const": "1.0"
    },
    "id": {
      "type": "string",
      "minLength": 1
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "nextSequence": {
      "type": "string",
      "pattern": "^[1-9][0-9]*(?![\\s\\S])"
    },
    "time": {
      "$ref": "https://redbook.fun/specification/1.0/schemas/time-rule.schema.json"
    },
    "presentation": {
      "$ref": "https://redbook.fun/specification/1.0/schemas/presentation.schema.json"
    },
    "settings": {
      "$ref": "https://redbook.fun/specification/1.0/schemas/value.schema.json#/$defs/map",
      "properties": {
        "resourceImports": {
          "type": "array",
          "items": {
            "$ref": "https://redbook.fun/specification/1.0/schemas/resource-import.schema.json"
          }
        }
      }
    },
    "elements": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "https://redbook.fun/specification/1.0/schemas/record.schema.json"
          },
          {
            "properties": {
              "primitive": {
                "const": "element"
              }
            }
          }
        ]
      }
    },
    "relationships": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "https://redbook.fun/specification/1.0/schemas/record.schema.json"
          },
          {
            "properties": {
              "primitive": {
                "const": "relationship"
              }
            }
          }
        ]
      }
    },
    "types": {
      "type": "array",
      "items": {
        "$ref": "https://redbook.fun/specification/1.0/schemas/type.schema.json"
      }
    },
    "assets": {
      "type": "array",
      "items": {
        "$ref": "https://redbook.fun/specification/1.0/schemas/asset.schema.json"
      }
    },
    "extensions": {
      "type": "array",
      "items": {
        "$ref": "https://redbook.fun/specification/1.0/schemas/extension-declaration.schema.json"
      }
    },
    "categories": {
      "type": "array",
      "items": {
        "$ref": "https://redbook.fun/specification/1.0/schemas/taxonomy.schema.json#/$defs/category"
      }
    },
    "tags": {
      "type": "array",
      "items": {
        "$ref": "https://redbook.fun/specification/1.0/schemas/taxonomy.schema.json#/$defs/tag"
      }
    }
  },
  "required": [
    "formatVersion",
    "id",
    "title",
    "description",
    "nextSequence",
    "time",
    "presentation",
    "settings",
    "elements",
    "relationships",
    "types",
    "assets",
    "extensions",
    "categories",
    "tags"
  ],
  "additionalProperties": false
}
