{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/asterwise-com/json-schema/asterwise-com-api-response-choghadiya-response-schema.json",
  "title": "ApiResponse[ChoghadiyaResponse]",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/asterwise-com-astro-api-openapi.yml#/components/schemas/ApiResponse_ChoghadiyaResponse_",
  "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/ChoghadiyaResponse",
      "description": "The endpoint response payload"
    }
  },
  "type": "object",
  "required": [
    "data"
  ],
  "$defs": {
    "ChoghadiyaPeriod": {
      "properties": {
        "period": {
          "type": "integer",
          "title": "Period",
          "description": "Period number, 1 to 8."
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Choghadiya name, e.g. Amrit, Shubh, Kaal."
        },
        "type": {
          "type": "string",
          "title": "Type",
          "description": "Classification: highly auspicious, auspicious, or inauspicious."
        },
        "ruling_planet": {
          "type": "string",
          "title": "Ruling Planet",
          "description": "Planet ruling this Choghadiya period."
        },
        "suitable_for": {
          "type": "string",
          "title": "Suitable For",
          "description": "Activities suited to this period."
        },
        "start": {
          "type": "string",
          "title": "Start",
          "description": "Period start time in HH:MM local time."
        },
        "start_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Start At",
          "description": "Period start time, ISO 8601 local time with date and UTC offset."
        },
        "start_utc": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Start Utc",
          "description": "Period start time, ISO 8601 UTC with Z."
        },
        "end": {
          "type": "string",
          "title": "End",
          "description": "Period end time in HH:MM local time."
        },
        "end_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "End At",
          "description": "Period end time, ISO 8601 local time with date and UTC offset."
        },
        "end_utc": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "End Utc",
          "description": "Period end time, ISO 8601 UTC with Z."
        },
        "is_current": {
          "type": "boolean",
          "title": "Is Current",
          "description": "True if this period is currently active."
        },
        "vela": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Vela",
          "description": "Barred ardha-prahara labels on this slot: 'Vaar Vela' (day and night), 'Kaal Vela' (day, Saturn's eighth) or 'Kaal Ratri' (night, Saturn's eighth). Avoid auspicious work in these. Empty when none."
        }
      },
      "type": "object",
      "required": [
        "period",
        "name",
        "type",
        "ruling_planet",
        "suitable_for",
        "start",
        "end",
        "is_current"
      ],
      "title": "ChoghadiyaPeriod"
    },
    "ChoghadiyaResponse": {
      "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 window 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",
          "description": "Date for which Choghadiya is calculated (YYYY-MM-DD)."
        },
        "sunrise": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sunrise",
          "description": "Sunrise time in HH:MM local time."
        },
        "sunrise_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sunrise At",
          "description": "Sunrise time, ISO 8601 local time with date and UTC offset."
        },
        "sunrise_utc": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sunrise Utc",
          "description": "Sunrise time, ISO 8601 UTC with Z."
        },
        "sunset": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sunset",
          "description": "Sunset time in HH:MM local time."
        },
        "sunset_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sunset At",
          "description": "Sunset time, ISO 8601 local time with date and UTC offset."
        },
        "sunset_utc": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sunset Utc",
          "description": "Sunset time, ISO 8601 UTC with Z."
        },
        "day_choghadiya": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ChoghadiyaPeriod"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Day Choghadiya",
          "description": "8 Choghadiya periods from sunrise to sunset."
        },
        "night_choghadiya": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ChoghadiyaPeriod"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Night Choghadiya",
          "description": "8 Choghadiya periods from sunset to next sunrise."
        }
      },
      "type": "object",
      "required": [
        "date"
      ],
      "title": "ChoghadiyaResponse"
    }
  }
}