{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://format.gbv.de/validate/format-schema.json",
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/definitions/id"
    },
    "title": {
      "type": "string"
    },
    "short": {
      "type": "string"
    },
    "url": {
      "$ref": "#/definitions/url"
    },
    "base": {
      "$ref": "#/definitions/ids"
    },
    "encodes": {
      "$ref": "#/definitions/ids"
    },
    "encodings": {
      "$ref": "#/definitions/ids"
    },
    "profiles": {
      "$ref": "#/definitions/ids"
    },
    "restricts": {
      "$ref": "#/definitions/ids"
    },
    "mimetypes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 1
    },
    "description": {
      "type": "string"
    },
    "fileExtension": {
      "type": "string"
    },
    "wikidata": {
      "type": "string",
      "pattern": "^Q[1-9][0-9]*$"
    },
    "versions": {
      "type": "object",
      "patternProperties": {
        "^[0-9a-z_/.-]+$": {
          "$ref": "#/definitions/version"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false,
  "definitions": {
    "id": {
      "type": "string",
      "pattern": "^[0-9a-z_/.-]+$"
    },
    "ids": {
      "anyOf": [
        {
          "$ref": "#/definitions/id"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/definitions/id"
          },
          "minItems": 1
        }
      ]
    },
    "url": {
      "type": "string",
      "format": "uri",
      "pattern": "^https?://"
    },
    "value": {
      "type": "string"
    },
    "version": {
      "type": "object",
      "properties": {
        "schemas": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/schema"
          },
          "minItems": 1
        }
      },
      "additionalProperties": true
    },
    "schema": {
      "type": "object",
      "required": [
        "type"
      ],
      "anyOf": [
        {
          "properties": {
            "type": {
              "$ref": "#/definitions/id"
            },
            "url": {
              "$ref": "#/definitions/url"
            }
          },
          "additionalProperties": false
        },
        {
          "properties": {
            "type": {
              "$ref": "#/definitions/id"
            },
            "value": {
              "$ref": "#/definitions/value"
            }
          },
          "additionalProperties": false
        }
      ]
    }
  }
}
