{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/parkypass-com/json-schema/parkypass-com-best-times-response-schema.json",
  "title": "BestTimesResponse",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/parkypass-com-openapi.json#/components/schemas/BestTimesResponse",
  "type": "object",
  "required": [
    "schema_version",
    "ride_id",
    "date",
    "predicted_hours",
    "typical_hours",
    "summary",
    "disney_forecast",
    "docs_url",
    "attribution",
    "generated_at"
  ],
  "properties": {
    "schema_version": {
      "type": "integer",
      "const": 1,
      "description": "Response format version. Fields are only added within a version."
    },
    "ride_id": {
      "type": "string"
    },
    "ride_name": {
      "type": "string"
    },
    "park_id": {
      "type": "string"
    },
    "park_name": {
      "type": "string"
    },
    "time_zone": {
      "type": "string"
    },
    "date": {
      "type": "string",
      "format": "date"
    },
    "day_of_week": {
      "type": "string"
    },
    "predicted_hours": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "hour": {
            "type": "integer",
            "minimum": 0,
            "maximum": 23,
            "description": "Park-local hour."
          },
          "local_time": {
            "type": "string"
          },
          "predicted_wait_minutes": {
            "type": [
              "number",
              "null"
            ]
          },
          "lower_bound": {
            "type": [
              "number",
              "null"
            ]
          },
          "upper_bound": {
            "type": [
              "number",
              "null"
            ]
          },
          "park_closed": {
            "type": "boolean"
          }
        }
      }
    },
    "typical_hours": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "hour": {
            "type": "integer"
          },
          "local_time": {
            "type": "string"
          },
          "typical_wait_minutes": {
            "type": [
              "number",
              "null"
            ]
          },
          "days_observed": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      }
    },
    "summary": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "basis": {
          "type": "string",
          "enum": [
            "predicted",
            "typical"
          ]
        },
        "best_windows": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BestTimeWindow"
          },
          "maxItems": 2
        },
        "worst_window": {
          "oneOf": [
            {
              "$ref": "#/$defs/BestTimeWindow"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "disney_forecast": {
      "type": [
        "object",
        "null"
      ],
      "description": "Disney's own hourly forecast for that day (Disney parks only; null elsewhere). Disney usually publishes today only.",
      "properties": {
        "hours": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "hour": {
                "type": "integer",
                "description": "Park-local hour."
              },
              "local_time": {
                "type": "string"
              },
              "forecast_at": {
                "type": "string",
                "format": "date-time"
              },
              "wait_minutes": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "busyness_percent": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Disney's busyness percentage for that hour, 0-100."
              }
            }
          }
        },
        "captured_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "data_status": {
          "type": "string",
          "enum": [
            "available",
            "unavailable"
          ]
        },
        "note": {
          "type": "string"
        }
      }
    },
    "prediction_generated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "model_version": {
      "type": [
        "string",
        "null"
      ]
    },
    "data_status": {
      "type": "string",
      "enum": [
        "predicted",
        "typical_only",
        "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."
        }
      }
    },
    "BestTimeWindow": {
      "type": "object",
      "required": [
        "start",
        "end",
        "start_hour",
        "end_hour",
        "average_wait_minutes"
      ],
      "properties": {
        "start": {
          "type": "string"
        },
        "end": {
          "type": "string"
        },
        "start_hour": {
          "type": "integer"
        },
        "end_hour": {
          "type": "integer"
        },
        "average_wait_minutes": {
          "type": "number"
        }
      }
    }
  }
}