{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/parkypass-com/json-schema/parkypass-com-hotel-availability-response-schema.json",
  "title": "HotelAvailabilityResponse",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/parkypass-com-openapi.json#/components/schemas/HotelAvailabilityResponse",
  "type": "object",
  "required": [
    "schema_version",
    "resort_id",
    "nights",
    "hotels",
    "docs_url",
    "attribution",
    "generated_at"
  ],
  "properties": {
    "schema_version": {
      "type": "integer",
      "const": 1,
      "description": "Response format version. Fields are only added within a version."
    },
    "resort_id": {
      "type": "string"
    },
    "resort_key": {
      "type": "string"
    },
    "resort_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "requested_from": {
      "type": "string",
      "format": "date"
    },
    "requested_to": {
      "type": "string",
      "format": "date"
    },
    "nights": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "night": {
            "type": "string",
            "format": "date"
          },
          "hotels_checked": {
            "type": [
              "integer",
              "null"
            ]
          },
          "hotels_sold_out": {
            "type": [
              "integer",
              "null"
            ]
          },
          "sold_out_share": {
            "type": [
              "number",
              "null"
            ]
          },
          "median_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "rate_index": {
            "type": [
              "number",
              "null"
            ],
            "description": "Median of each hotel's rate relative to its own typical rate (1.0 = typical)."
          },
          "rooms_left_at_lowest_rate": {
            "type": [
              "integer",
              "null"
            ]
          },
          "captured_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      }
    },
    "hotels": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "hotel_id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "tier": {
            "type": [
              "string",
              "null"
            ]
          },
          "night": {
            "type": "string",
            "format": "date"
          },
          "adults": {
            "type": [
              "integer",
              "null"
            ]
          },
          "available": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "rack_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "room_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "rooms_left": {
            "type": [
              "integer",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "captured_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      }
    },
    "data_status": {
      "type": "string",
      "enum": [
        "available",
        "unavailable"
      ]
    },
    "note": {
      "type": "string"
    },
    "docs_url": {
      "type": "string",
      "format": "uri",
      "description": "Developer documentation."
    },
    "attribution": {
      "$ref": "#/$defs/Attribution"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time",
      "description": "When Parky built this response."
    }
  },
  "$defs": {
    "Attribution": {
      "type": "object",
      "required": [
        "text",
        "url",
        "required"
      ],
      "description": "Required credit. Wherever Parky data is shown, display `text` with a visible link to `url`; the link must stay visible.",
      "properties": {
        "text": {
          "type": "string",
          "const": "Live data from parkypass.com",
          "description": "Text to display."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The matching parkypass.com page to link."
        },
        "required": {
          "type": "boolean",
          "const": true,
          "description": "Always true: attribution is a condition of use."
        }
      }
    }
  }
}