{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/asterwise-com/json-schema/asterwise-com-api-response-planetary-hours-response-schema.json",
  "title": "ApiResponse[PlanetaryHoursResponse]",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/asterwise-com-western-api-openapi.yml#/components/schemas/ApiResponse_PlanetaryHoursResponse_",
  "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/PlanetaryHoursResponse",
      "description": "The endpoint response payload"
    }
  },
  "type": "object",
  "required": [
    "data"
  ],
  "$defs": {
    "PlanetaryHour": {
      "properties": {
        "hour": {
          "type": "integer",
          "maximum": 24.0,
          "minimum": 1.0,
          "title": "Hour",
          "description": "1–12 are day hours (sunrise to sunset), 13–24 night hours."
        },
        "period": {
          "type": "string",
          "enum": [
            "day",
            "night"
          ],
          "title": "Period"
        },
        "planet": {
          "type": "string",
          "title": "Planet",
          "description": "Planet ruling this hour."
        },
        "start_local": {
          "type": "string",
          "title": "Start Local",
          "description": "Start, local time with UTC offset (ISO 8601)."
        },
        "end_local": {
          "type": "string",
          "title": "End Local",
          "description": "End, local time with UTC offset (ISO 8601)."
        },
        "start_utc": {
          "type": "string",
          "title": "Start Utc",
          "description": "Start in UTC (ISO 8601 with Z)."
        },
        "end_utc": {
          "type": "string",
          "title": "End Utc",
          "description": "End in UTC (ISO 8601 with Z)."
        },
        "length_minutes": {
          "type": "number",
          "title": "Length Minutes"
        },
        "is_current": {
          "type": "boolean",
          "title": "Is Current",
          "description": "True if the current moment falls in this hour."
        }
      },
      "type": "object",
      "required": [
        "hour",
        "period",
        "planet",
        "start_local",
        "end_local",
        "start_utc",
        "end_utc",
        "length_minutes",
        "is_current"
      ],
      "title": "PlanetaryHour"
    },
    "PlanetaryHoursResponse": {
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "ok",
            "no_sunrise"
          ],
          "title": "Status",
          "description": "ok, or no_sunrise when the place has no sunrise or sunset on that date (polar latitudes): the hour fields are then null.",
          "default": "ok"
        },
        "status_detail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Status Detail",
          "description": "Plain-English reason when status is not ok."
        },
        "date": {
          "type": "string",
          "title": "Date"
        },
        "weekday": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Weekday",
          "description": "Weekday of the date, e.g. Sunday."
        },
        "day_ruler": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Day Ruler",
          "description": "Planet of the weekday; it rules the first hour after sunrise."
        },
        "convention": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Convention",
          "description": "unequal_seasonal: day and night each split into 12 equal parts from real sunrise and sunset."
        },
        "sunrise_local": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sunrise Local"
        },
        "sunset_local": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sunset Local"
        },
        "next_sunrise_local": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Next Sunrise Local"
        },
        "sunrise_utc": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sunrise Utc"
        },
        "sunset_utc": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sunset Utc"
        },
        "next_sunrise_utc": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Next Sunrise Utc"
        },
        "day_hour_minutes": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Day Hour Minutes",
          "description": "Length of one day hour in minutes."
        },
        "night_hour_minutes": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Night Hour Minutes",
          "description": "Length of one night hour in minutes."
        },
        "hours": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/PlanetaryHour"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Hours",
          "description": "The 24 hours; null when status is no_sunrise."
        }
      },
      "type": "object",
      "required": [
        "date"
      ],
      "title": "PlanetaryHoursResponse"
    }
  }
}