{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thinair-co/json-schema/thinair-co-geofence-validate-request-schema.json",
  "title": "GeofenceValidateRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thinair-co-geofences-api-openapi.yml#/components/schemas/GeofenceValidateRequest",
  "type": "object",
  "properties": {
    "polygon": {
      "$ref": "#/$defs/GeofencePolygon"
    }
  },
  "required": [
    "polygon"
  ],
  "$defs": {
    "GeofencePolygon": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "Polygon"
              ]
            },
            "coordinates": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  },
                  "minItems": 2,
                  "maxItems": 3
                }
              }
            }
          },
          "required": [
            "type",
            "coordinates"
          ]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "MultiPolygon"
              ]
            },
            "coordinates": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "minItems": 2,
                    "maxItems": 3
                  }
                }
              }
            }
          },
          "required": [
            "type",
            "coordinates"
          ]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "Feature"
              ]
            },
            "geometry": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "additionalProperties": {}
            },
            "properties": {
              "type": [
                "object",
                "null"
              ],
              "additionalProperties": {}
            }
          },
          "required": [
            "type",
            "geometry"
          ]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "FeatureCollection"
              ]
            },
            "features": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "Feature"
                    ]
                  },
                  "geometry": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": {}
                  },
                  "properties": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "type",
                  "geometry"
                ]
              },
              "maxItems": 100
            }
          },
          "required": [
            "type",
            "features"
          ]
        }
      ],
      "description": "A GeoJSON Polygon / MultiPolygon geometry, a Feature wrapping one, or a FeatureCollection of them. Ring geometry is validated server-side (closure, winding, self-intersection, complexity limits)."
    }
  }
}