{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "GeoList",
    "description": "This is the document root element. It contains a sequence of Geo elements.",
    "items": {
        "$ref": "#/definitions/GeoList"
    },
    "type": "array",
    "definitions": {
        "GeoList": {
            "type": "object",
            "minItems": 0,
            "required": [
                "id",
                "typeId"
            ],
            "properties": {
                "id": {"type": "integer"},
                "typeId": {"type": "integer"},
                "Name": {
                    "type": "array",
                    "items": {"$ref": "#/definitions/Name"},
                    "minItems": 0
                },
                "TripAdvisorURL": {
                    "type": "string",
                    "format": "iri",
                    "description": "URL on the TA site"
                },
                "HotelsURL": {
                    "type": "string",
                    "format": "iri",
                    "description": "URL to view hotels for the geo"
                },
                "RestaurantsURL": {
                    "type": "string",
                    "format": "iri",
                    "description": "URL to view restaurants for the geo"
                },
                "AttractionsURL": {
                    "type": "string",
                    "format": "iri",
                    "description": "URL to view attractions for the geo"
                },
                "FlightsURL": {
                    "type": "string",
                    "format": "iri",
                    "description": "URL to view flights for the geo"
                },
                "ViewPhotosURL": {
                    "type": "string",
                    "format": "iri",
                    "description": "URL for the view photos link"
                },
                "SeeAllPhotosURL": {
                    "type": "string",
                    "format": "iri",
                    "description": "URL for the photo albums of geo"
                },
                "Type": {
                    "type": "object",
                    "description": "Type information: TypeName - is e.g. Country, State, Island, lang - is the language of the TypeName",
                    "required": [
                        "lang",
                        "TypeName"
                    ],
                    "properties": {
                        "lang": {"type": "string"},
                        "TypeName": {"type": "string"}

                    }
                },
                "Description": {
                    "type": "array",
                    "description": "Localized geo description",
                    "items": {"$ref": "#/definitions/Description"},
                    "minItems": 0
                },
                "Latitude": {
                    "type": "number",
                    "description": "Latitude for this geo, if we have it and can distribute it"
                },
                "Longitude": {
                    "type": "number",
                    "description": "Longitude for this geo, if we have it and can distribute it"
                },
                "Awards": {
                    "type": "array",
                    "description": "Awards for this geo",
                    "items": {"$ref": "#/definitions/Awards"},
                    "minItems": 0
                },
                "ChildGeos": {
                    "type": "array",
                    "description": "Children geos, only appears if Geo is a country, island, state, region",
                    "items": {"$ref": "#/definitions/ChildGeos"},
                    "minItems": 0
                },
                "TopProperties": {
                    "type": "array",
                    "description": "Top hotels, restaurants, attractions in this geo",
                    "items": {"$ref": "#/definitions/TopProperties"},
                    "minItems": 0
                },
                "Ancestors": {
                    "type": "array",
                    "description": "Ancestors of the geo",
                    "items": {"$ref": "#/definitions/Ancestors"},
                    "minItems": 0
                },
                "NearestAirports": {
                    "type": "array",
                    "description": "The nearest airport to the center of the Geo. Not applicable to Country-level Geos",
                    "items": {"$ref": "#/definitions/NearestAirports"},
                    "minItems": 0
                },
                "GeoHierarchy": {"type": "string"}
            }
        },
        "Name": {
            "type": "object",
            "required": ["lang"],
            "properties": {
                "lang": {"type": "string"},
                "value": {"type": "string"}
            }
        },
        "Description": {
            "type": "object",
            "required": ["lang"],
            "properties": {
                "lang": {"type": "string"},
                "value": {"type": "string"}
            }
        },
        "Awards": {
            "type": "object",
            "required": [
                "type",
                "year",
                "name",
                "tinyImageUrl",
                "smallImageUrl",
                "largeImageUrl"
            ],
            "properties": {
                "type": {"type": "string"},
                "year": {"type": "integer"},
                "name": {"type": "string"},
                "categories": {
                    "type": "array",
                    "items": {"type": "string"},
                    "minItems": 0
                },
                "tinyImageUrl": {
                    "type": "string",
                    "format": "iri"
                },
                "smallImageUrl": {
                    "type": "string",
                    "format": "iri"
                },
                "largeImageUrl": {
                    "type": "string",
                    "format": "iri"
                }
            }
        },
        "ChildGeos": {
            "type": "object",
            "description": "Child geo element, id is of the child geo",
            "properties": {
                "id": {"type": "integer"},
                "rank": {"type": "integer"}
            }
        },
        "TopProperties": {
            "type": "object",
            "description": "id - is the property, type - is hotel, restaurant, or attraction",
            "required": [
                "id",
                "rank",
                "type"
            ],
            "properties": {
                "id": {"type": "integer"},
                "rank": {"type": "integer"},
                "type": {"type": "string"}
            }
        },
        "Ancestors": {
            "type": "object",
            "description": "id - is the location id of the ancestor, level - is district, province, country, etc.",
            "properties": {
                "Name": {
                    "type": "array",
                    "items": {"$ref": "#/definitions/Name"},
                    "minItems": 0
                },
                "id": {"type": "integer"},
                "level": {"type": "string"}
            }
        },
        "NearestAirports": {
            "type": "object",
            "description": "IATA airport code, name, and distance between the center of the Geo and the airport",
            "required": [
                "Code",
                "Distance"
            ],
            "properties": {
                "Code": {"type": "string"},
                "Name": {
                    "type": "array",
                    "items": {"$ref": "#/definitions/Name"},
                    "minItems": 0
                },
                "Distance": {"type": "string"}
            }
        }
    }
}