{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://stac-extensions.github.io/version/v1.1.0/schema.json#",
  "title": "Versioning Indicators Extension",
  "description": "STAC Versioning Indicators Extension for STAC Items and STAC Collections.",
  "oneOf": [
    {
      "$comment": "This is the schema for STAC Items.",
      "allOf": [
        {
          "$ref": "#/definitions/stac_extensions"
        },
        {
          "type": "object",
          "required": [
            "type",
            "properties",
            "assets"
          ],
          "properties": {
            "type": {
              "const": "Feature"
            },
            "properties": {
              "$ref": "#/definitions/fields"
            },
            "assets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/definitions/fields"
              }
            }
          }
        }
      ]
    },
    {
      "$comment": "This is the schema for STAC Collections.",
      "type": "object",
      "allOf": [
        {
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "const": "Collection"
            }
          }
        },
        {
          "$ref": "#/definitions/stac_extensions"
        },
        {
          "$comment": "This is the schema for the top-level fields in a Collection.",
          "allOf": [
            {
              "$ref": "#/definitions/fields"
            }
          ]
        },
        {
          "$comment": "This validates the fields in Collection Assets.",
          "properties": {
            "assets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/definitions/fields"
              }
            }
          }
        },
        {
          "$comment": "This is the schema for the fields in Item Asset Definitions.",
          "properties": {
            "item_assets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/definitions/fields"
              }
            }
          }
        }
      ]
    },
    {
      "$comment": "This is the schema for STAC Catalog.",
      "allOf": [
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "const": "Catalog"
            }
          }
        },
        {
          "$ref": "#/definitions/stac_extensions"
        },
        {
          "$ref": "#/definitions/fields"
        }
      ]
    }
  ],
  "definitions": {
    "stac_extensions": {
      "type": "object",
      "required": [
        "stac_extensions"
      ],
      "properties": {
        "stac_extensions": {
          "type": "array",
          "contains": {
            "const": "https://stac-extensions.github.io/version/v1.1.0/schema.json"
          }
        }
      }
    },
    "fields": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string",
          "title": "Version"
        },
        "deprecated": {
          "type": "boolean",
          "title": "Deprecated",
          "default": false
        }
      }
    }
  }
}
