{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.schemastore.org/openapi-3.X.json",
  "title": "OpenAPI Document v3.X",
  "type": "object",
  "required": ["openapi"],
  "properties": {
    "openapi": {
      "pattern": "^3\\.[0-2]\\.",
      "type": "string"
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "openapi": {
            "pattern": "^3\\.0\\.",
            "type": "string"
          }
        }
      },
      "then": {
        "$comment": "3.0 only uses its own dialect and doesn't have a schema base variant",
        "$ref": "https://spec.openapis.org/oas/3.0/schema/2024-10-18"
      }
    },
    {
      "if": {
        "properties": {
          "openapi": {
            "pattern": "^3\\.1\\.",
            "type": "string"
          }
        }
      },
      "then": {
        "$ref": "https://spec.openapis.org/oas/3.1/schema-base/2026-08-03"
      }
    },
    {
      "if": {
        "properties": {
          "openapi": {
            "pattern": "^3\\.2\\.",
            "type": "string"
          }
        }
      },
      "then": {
        "$ref": "https://spec.openapis.org/oas/3.2/schema-base/2026-08-30"
      }
    }
  ]
}
