{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/parkypass-com/json-schema/parkypass-com-hours-response-schema.json",
  "title": "HoursResponse",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/parkypass-com-openapi.json#/components/schemas/HoursResponse",
  "type": "object",
  "required": [
    "schema_version",
    "park_id",
    "days",
    "data_status",
    "docs_url",
    "attribution",
    "generated_at"
  ],
  "properties": {
    "schema_version": {
      "type": "integer",
      "const": 1,
      "description": "Response format version. Fields are only added within a version."
    },
    "park_id": {
      "type": "string"
    },
    "park_name": {
      "type": "string"
    },
    "time_zone": {
      "type": "string"
    },
    "days": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "is_operating": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "open_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "close_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "schedule_windows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string",
                  "enum": [
                    "early_entry",
                    "regular_hours",
                    "extended_hours",
                    "special_event",
                    "unknown"
                  ]
                },
                "display_label": {
                  "type": "string"
                },
                "start_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "end_at": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      }
    },
    "requested_from": {
      "type": "string",
      "format": "date"
    },
    "requested_to": {
      "type": "string",
      "format": "date"
    },
    "missing_dates": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "date"
      }
    },
    "data_status": {
      "type": "string",
      "enum": [
        "available",
        "partial",
        "unavailable"
      ]
    },
    "hours_published": {
      "type": "boolean",
      "const": false,
      "description": "Present, false, when the requested date is after last_available_date; days is then empty."
    },
    "last_available_date": {
      "type": "string",
      "format": "date",
      "description": "The last park-local date Parky serves hours for. Present when the request reached past it."
    },
    "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."
        }
      }
    }
  }
}