{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/casafari/json-schema/casafari-api-locations-v1-schema.json",
  "title": "ApiLocationsV1",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/casafari-api-references-api-openapi.yml#/components/schemas/ApiLocationsV1",
  "properties": {
    "locations": {
      "items": {
        "properties": {
          "location_id": {
            "type": "integer",
            "description": "ID of the location."
          },
          "name": {
            "type": "string",
            "description": "Name of the location."
          },
          "parent_id": {
            "type": "integer",
            "description": "ID of the parent level location."
          },
          "administrative_level": {
            "type": "string",
            "description": "Location administrative level."
          },
          "locations_structure": {
            "items": {
              "properties": {
                "location_id": {
                  "type": "integer",
                  "description": "('Location ID, as returned by the [POST /api/v1/references/locations](/#operation/api__post__v1__references__locations) endpoint.',)"
                },
                "name": {
                  "type": "string",
                  "description": "Location name."
                },
                "administrative_level": {
                  "type": "string",
                  "description": "Location administrative level."
                },
                "zip_codes": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array",
                  "description": "The location zip codes.",
                  "default": []
                },
                "level": {
                  "type": "integer",
                  "description": "Location level as number."
                }
              },
              "type": "object",
              "required": [
                "location_id",
                "name",
                "administrative_level",
                "level"
              ]
            },
            "type": "array",
            "description": "Information about all the parent locations, starting from the top-most level - country."
          }
        },
        "type": "object",
        "required": [
          "location_id",
          "name",
          "parent_id",
          "administrative_level",
          "locations_structure"
        ]
      },
      "type": "array",
      "description": "List of location objects."
    }
  },
  "type": "object",
  "required": [
    "locations"
  ]
}