{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/asterwise-com/json-schema/asterwise-com-chart-request-schema.json",
  "title": "ChartRequest",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/asterwise-com-openapi.json#/components/schemas/ChartRequest",
  "properties": {
    "location": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Location",
      "description": "City name to resolve to lat/lon/tz automatically. Example: 'Mumbai' or 'New Delhi, India'. If provided, latitude, longitude and timezone are not required."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "title": "Name",
      "description": "Person name associated with the birth record",
      "default": "Chart"
    },
    "date": {
      "type": "string",
      "title": "Date",
      "description": "Birth date in YYYY-MM-DD format"
    },
    "time": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Time",
      "description": "Birth time in HH:MM 24-hour format. If omitted, sunrise chart is used as fallback."
    },
    "latitude": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 90.0,
          "minimum": -90.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Latitude",
      "description": "Latitude. Required if location not provided."
    },
    "longitude": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 180.0,
          "minimum": -180.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Longitude",
      "description": "Longitude. Required if location not provided."
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Timezone",
      "description": "IANA timezone. Required if location not provided (unless utc_offset is given). For dates before the zone adopted a standard time, the birthplace's local mean time (longitude / 15 hours) is used."
    },
    "utc_offset": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Utc Offset",
      "description": "Optional explicit UTC offset of the birth time, as ±HH:MM or ±HH:MM:SS (e.g. '+04:51:31' for Bombay mean time). Overrides the offset `timezone` would give. Use it when the birth record states the offset, or for historical local times the IANA database cannot represent."
    },
    "ayanamsa": {
      "type": "string",
      "enum": [
        "lahiri",
        "raman",
        "kp",
        "tropical"
      ],
      "title": "Ayanamsa",
      "description": "Sidereal ayanamsa mode used in calculations",
      "default": "lahiri"
    },
    "vargas": {
      "anyOf": [
        {
          "items": {
            "type": "string",
            "enum": [
              "D1",
              "D2",
              "D3",
              "D4",
              "D7",
              "D9",
              "D10",
              "D12",
              "D16",
              "D20",
              "D24",
              "D27",
              "D30",
              "D40",
              "D45",
              "D60"
            ]
          },
          "type": "array",
          "maxItems": 16,
          "minItems": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Vargas",
      "description": "Divisional charts to draw, any of the 16 (D1 to D60). Returned in `vargas`. Leave out for the classic response (D1 and D9 only)."
    },
    "styles": {
      "items": {
        "type": "string",
        "enum": [
          "north",
          "south",
          "east"
        ]
      },
      "type": "array",
      "maxItems": 3,
      "minItems": 1,
      "title": "Styles",
      "description": "Chart styles for `vargas`: north (diamond), south (fixed-sign grid), east (Bengali, fixed signs with Aries at the top middle). Applies to `vargas` only: the classic lagna_*/navamsa_* fields are always north and south.",
      "default": [
        "north",
        "south"
      ]
    },
    "show_degrees": {
      "type": "boolean",
      "title": "Show Degrees",
      "description": "Show each graha's degree and minutes in its sign (and the Lagna degree).",
      "default": true
    },
    "theme": {
      "type": "string",
      "enum": [
        "light",
        "dark"
      ],
      "title": "Theme",
      "description": "Colour preset.",
      "default": "light"
    },
    "colors": {
      "anyOf": [
        {
          "$ref": "#/$defs/ChartColors"
        },
        {
          "type": "null"
        }
      ],
      "description": "Override any colour of the chosen theme (hex #RRGGBB)."
    },
    "transparent": {
      "type": "boolean",
      "title": "Transparent",
      "description": "No background fill, so the chart sits on your own page colour.",
      "default": false
    },
    "show_details": {
      "type": "boolean",
      "title": "Show Details",
      "description": "Print the name (when sent), birth date, time and place under the title; cut to 80 characters.",
      "default": false
    }
  },
  "type": "object",
  "required": [
    "date"
  ],
  "$defs": {
    "ChartColors": {
      "properties": {
        "background": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^#[0-9A-Fa-f]{6}$"
            },
            {
              "type": "null"
            }
          ],
          "title": "Background",
          "description": "Chart background, e.g. #FFFFFF"
        },
        "line": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^#[0-9A-Fa-f]{6}$"
            },
            {
              "type": "null"
            }
          ],
          "title": "Line",
          "description": "Frame and house lines"
        },
        "text": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^#[0-9A-Fa-f]{6}$"
            },
            {
              "type": "null"
            }
          ],
          "title": "Text",
          "description": "Planet labels and title"
        },
        "muted": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^#[0-9A-Fa-f]{6}$"
            },
            {
              "type": "null"
            }
          ],
          "title": "Muted",
          "description": "Sign labels, sign and house numbers, legend"
        },
        "lagna_highlight": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^#[0-9A-Fa-f]{6}$"
            },
            {
              "type": "null"
            }
          ],
          "title": "Lagna Highlight",
          "description": "Fill of the Lagna house"
        },
        "retro": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^#[0-9A-Fa-f]{6}$"
            },
            {
              "type": "null"
            }
          ],
          "title": "Retro",
          "description": "R (Vakri) mark"
        },
        "combust": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^#[0-9A-Fa-f]{6}$"
            },
            {
              "type": "null"
            }
          ],
          "title": "Combust",
          "description": "C (Asta) mark"
        },
        "vargottama": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^#[0-9A-Fa-f]{6}$"
            },
            {
              "type": "null"
            }
          ],
          "title": "Vargottama",
          "description": "V (Vargottama) mark"
        },
        "exalted": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^#[0-9A-Fa-f]{6}$"
            },
            {
              "type": "null"
            }
          ],
          "title": "Exalted",
          "description": "↑ (exalted) mark"
        },
        "debilitated": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^#[0-9A-Fa-f]{6}$"
            },
            {
              "type": "null"
            }
          ],
          "title": "Debilitated",
          "description": "↓ (debilitated) mark"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "ChartColors"
    }
  }
}