{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/travelminds-ai/json-schema/travelminds-ai-city-out-schema.json",
  "title": "CityOut",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/travelminds-ai-openapi.json#/components/schemas/CityOut",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id",
      "description": "Canonical city UUID. Stable across reads."
    },
    "name": {
      "type": "string",
      "title": "Name",
      "description": "City name in source script (en preferred when both exist)."
    },
    "iso_alpha2": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Iso Alpha2",
      "description": "ISO-3166 alpha-2 country code, uppercase (e.g. 'IN', 'JP')."
    },
    "population": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Population",
      "description": "Latest known population from source metadata."
    },
    "latitude": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Latitude",
      "description": "Decimal degrees, signed (string for arbitrary precision)."
    },
    "longitude": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Longitude",
      "description": "Decimal degrees, signed (string for arbitrary precision)."
    },
    "master_score": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Master Score",
      "description": "Composite master score on a 0-100 scale (higher ranks higher), rounded to 2dp; the values held ran from 15.56 to 92.35 on 14 November 2026."
    },
    "tier": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Tier",
      "description": "Internal classification tier (e.g. 'tier-1', 'tier-2')."
    },
    "child_city_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Child City Count",
      "description": "Number of child neighborhoods/boroughs aggregated under this row (W52 rollup)."
    },
    "aggregates_neighborhoods": {
      "type": "boolean",
      "title": "Aggregates Neighborhoods",
      "description": "True when this is a megacity row that rolls up child neighborhoods (NYC, London, Paris, Tokyo).",
      "default": false
    },
    "license": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "License",
      "description": "License id from the registry (D7 posture). See GET /v1/licenses."
    },
    "license_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "License Url",
      "description": "Public URL of the license text."
    },
    "attribution_required": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Attribution Required",
      "description": "True if downstream use must cite TravelMindsAI / the upstream source."
    }
  },
  "type": "object",
  "required": [
    "id",
    "name"
  ]
}