{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/traveltype-app/json-schema/traveltype-app-city-detail-schema.json",
  "title": "CityDetail",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/traveltype-app-openapi.json#/components/schemas/CityDetail",
  "allOf": [
    {
      "$ref": "#/$defs/CitySummary"
    },
    {
      "type": "object",
      "properties": {
        "top_tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "top_categories": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "slug",
              "label"
            ],
            "properties": {
              "slug": {
                "type": "string"
              },
              "label": {
                "type": "string"
              }
            }
          }
        },
        "sample_pois": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Poi"
          }
        }
      }
    }
  ],
  "$defs": {
    "CitySummary": {
      "type": "object",
      "required": [
        "slug",
        "name",
        "country_iso2",
        "lat",
        "lng",
        "poi_count"
      ],
      "properties": {
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "name_en": {
          "type": [
            "string",
            "null"
          ]
        },
        "country_iso2": {
          "type": "string"
        },
        "lat": {
          "type": "number",
          "format": "double"
        },
        "lng": {
          "type": "number",
          "format": "double"
        },
        "poi_count": {
          "type": "integer"
        },
        "wikidata_qid": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "Poi": {
      "type": "object",
      "required": [
        "id",
        "slug",
        "name",
        "lat",
        "lng",
        "tags"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "city_slug": {
          "type": [
            "string",
            "null"
          ]
        },
        "country_iso2": {
          "type": [
            "string",
            "null"
          ]
        },
        "lat": {
          "type": "number",
          "format": "double"
        },
        "lng": {
          "type": "number",
          "format": "double"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 8,
          "description": "Up to 8 most distinctive approved tag slugs (sensitive categories excluded)."
        },
        "categories": {
          "type": "array",
          "description": "Coarse groupings the POI belongs to, with localized label.",
          "items": {
            "type": "object",
            "required": [
              "slug",
              "label"
            ],
            "properties": {
              "slug": {
                "type": "string"
              },
              "label": {
                "type": "string"
              }
            }
          }
        },
        "wikidata_qid": {
          "type": [
            "string",
            "null"
          ]
        },
        "osm_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "OSM reference in `type/id` form."
        },
        "google_place_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "image_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Absolute URL to the locally-hosted hero image."
        },
        "image_source": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "wikimedia",
            "google",
            "user",
            null
          ]
        },
        "url": {
          "type": "string"
        }
      }
    }
  }
}