{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://romania-uat.local/schemas/course-points.schema.json",
  "title": "Course Points",
  "type": "object",
  "required": ["generated", "items"],
  "properties": {
    "generated": {
      "type": "boolean"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id", "type", "boundary_level", "label", "geometry"],
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "const": "boundary-crossing"
          },
          "boundary_level": {
            "type": "string"
          },
          "from_id": {
            "type": ["string", "integer", "null"]
          },
          "to_id": {
            "type": ["string", "integer", "null"]
          },
          "label": {
            "type": "string"
          },
          "geometry": {
            "type": "object",
            "required": ["type", "coordinates"],
            "properties": {
              "type": {
                "type": "string",
                "const": "Point"
              },
              "coordinates": {
                "type": "array",
                "minItems": 2,
                "maxItems": 2,
                "items": {
                  "type": "number"
                }
              }
            },
            "additionalProperties": true
          },
          "route_refs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": true
      }
    }
  },
  "additionalProperties": true
}
