{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bodyspec/json-schema/bodyspec-location-response-schema.json",
  "title": "LocationResponse",
  "description": "Response model for getting a single location.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bodyspec-locations-api-openapi.yml#/components/schemas/LocationResponse",
  "properties": {
    "location": {
      "$ref": "#/$defs/Location"
    }
  },
  "type": "object",
  "required": [
    "location"
  ],
  "x-internal": true,
  "$defs": {
    "Address": {
      "properties": {
        "address_line1": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Address Line1",
          "description": "Primary address line"
        },
        "address_line2": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Address Line2",
          "description": "Secondary address line (e.g., suite number)"
        },
        "city": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "City",
          "description": "City name"
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "State",
          "description": "State or province"
        },
        "postal_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Postal Code",
          "description": "Postal/ZIP code"
        },
        "country": {
          "type": "string",
          "title": "Country",
          "description": "Two-letter ISO country code",
          "default": "US"
        }
      },
      "type": "object",
      "title": "Address",
      "description": "Address information for a location.",
      "x-internal": true
    },
    "Coordinates": {
      "properties": {
        "latitude": {
          "type": "number",
          "title": "Latitude",
          "description": "Latitude in decimal degrees"
        },
        "longitude": {
          "type": "number",
          "title": "Longitude",
          "description": "Longitude in decimal degrees"
        }
      },
      "type": "object",
      "required": [
        "latitude",
        "longitude"
      ],
      "title": "Coordinates",
      "description": "Geographic coordinates for a location.",
      "x-internal": true
    },
    "Location": {
      "properties": {
        "location_id": {
          "type": "string",
          "title": "Location Id",
          "description": "Unique identifier for the location"
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Location name"
        },
        "location_type": {
          "type": "string",
          "title": "Location Type",
          "description": "Type of location: 'mobile' or 'storefront'"
        },
        "address": {
          "$ref": "#/$defs/Address",
          "description": "Address information"
        },
        "coordinates": {
          "anyOf": [
            {
              "$ref": "#/$defs/Coordinates"
            },
            {
              "type": "null"
            }
          ],
          "description": "Geographic coordinates"
        },
        "timezone": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Timezone",
          "description": "IANA timezone identifier (e.g., 'America/Los_Angeles')"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description",
          "description": "Public notes or description"
        },
        "last_updated": {
          "type": "string",
          "format": "date-time",
          "title": "Last Updated",
          "description": "Last update timestamp in ISO 8601 UTC format"
        },
        "distance_miles": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Distance Miles",
          "description": "Distance from search coordinates in miles. Only present when lat/lng search parameters are provided."
        }
      },
      "type": "object",
      "required": [
        "location_id",
        "name",
        "location_type",
        "address",
        "last_updated"
      ],
      "title": "Location",
      "description": "Location model representing a scan location with full details."
    }
  }
}