{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/asterwise-com/json-schema/asterwise-com-api-response-geocode-response-schema.json",
  "title": "ApiResponse[GeocodeResponse]",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/asterwise-com-utilities-api-openapi.yml#/components/schemas/ApiResponse_GeocodeResponse_",
  "properties": {
    "success": {
      "type": "boolean",
      "title": "Success",
      "description": "True if the request succeeded",
      "default": true
    },
    "message": {
      "type": "string",
      "title": "Message",
      "description": "Human-readable status message",
      "default": "success"
    },
    "data": {
      "$ref": "#/$defs/GeocodeResponse",
      "description": "The endpoint response payload"
    }
  },
  "type": "object",
  "required": [
    "data"
  ],
  "$defs": {
    "GeocodeResponse": {
      "properties": {
        "query": {
          "type": "string",
          "title": "Query",
          "description": "The search query as received."
        },
        "count": {
          "type": "integer",
          "title": "Count",
          "description": "Number of results returned."
        },
        "ambiguous": {
          "type": "boolean",
          "title": "Ambiguous",
          "description": "True if multiple locations matched the query."
        },
        "results": {
          "items": {
            "$ref": "#/$defs/GeocodeResult"
          },
          "type": "array",
          "title": "Results",
          "description": "List of matching locations, best match first. Repeat matches for one place (same city, state and country within 5 km) are listed once."
        },
        "tip": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tip",
          "description": "Disambiguation hint when ambiguous is True."
        }
      },
      "type": "object",
      "required": [
        "query",
        "count",
        "ambiguous",
        "results"
      ],
      "title": "GeocodeResponse"
    },
    "GeocodeResult": {
      "properties": {
        "label": {
          "type": "string",
          "title": "Label",
          "description": "Human-readable location label."
        },
        "city": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "City",
          "description": "City name."
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "State",
          "description": "State or region."
        },
        "country": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Country",
          "description": "Country name."
        },
        "latitude": {
          "type": "number",
          "title": "Latitude",
          "description": "Latitude in decimal degrees."
        },
        "longitude": {
          "type": "number",
          "title": "Longitude",
          "description": "Longitude in decimal degrees."
        },
        "timezone": {
          "type": "string",
          "title": "Timezone",
          "description": "IANA timezone identifier."
        },
        "place_id": {
          "type": "string",
          "title": "Place Id",
          "description": "Nominatim place ID."
        }
      },
      "type": "object",
      "required": [
        "label",
        "latitude",
        "longitude",
        "timezone",
        "place_id"
      ],
      "title": "GeocodeResult"
    }
  }
}