| { |
| "$schema": "https://json-schema.org/draft/2020-12/schema", |
| "$id": "https://example.invalid/calcchinesecalendar/web/v1/schema.json", |
| "title": "CalcChineseCalendar static Web data v1", |
| "type": "object", |
| "oneOf": [ |
| {"$ref": "#/$defs/calendarMonth"}, |
| {"$ref": "#/$defs/eclipseYear"}, |
| {"$ref": "#/$defs/astroMonth"} |
| ], |
| "$defs": { |
| "civil": { |
| "type": "array", |
| "prefixItems": [ |
| {"type": "integer"}, |
| {"type": "integer", "minimum": 1, "maximum": 12}, |
| {"type": "integer", "minimum": 1, "maximum": 31} |
| ], |
| "minItems": 3, |
| "maxItems": 3 |
| }, |
| "lunarDate": { |
| "description": "[lunar year, month number, day number, leap flag]", |
| "type": "array", |
| "prefixItems": [ |
| {"type": "integer"}, |
| {"type": "integer", "minimum": 1, "maximum": 12}, |
| {"type": "integer", "minimum": 1, "maximum": 30}, |
| {"type": "integer", "enum": [0, 1]} |
| ], |
| "minItems": 4, |
| "maxItems": 4 |
| }, |
| "preciseEvent": { |
| "type": "object", |
| "required": ["kind", "code", "day", "sec", "civil", "jd_tdb", "jd_utc"], |
| "properties": { |
| "kind": {"enum": ["solar_term", "lunar_phase"]}, |
| "code": {"type": "string"}, |
| "day": {"type": "integer", "minimum": 1, "maximum": 31}, |
| "sec": {"type": "integer", "minimum": 0, "maximum": 86399}, |
| "civil": {"$ref": "#/$defs/civil"}, |
| "jd_tdb": {"type": "number"}, |
| "jd_utc": {"type": "number"}, |
| "utc_iso": {"type": "string"}, |
| "local_iso": {"type": "string"} |
| }, |
| "additionalProperties": false |
| }, |
| "daySummary": { |
| "type": "object", |
| "required": ["d", "w", "l", "fest", "terms", "phases", "solar_eclipses", "lunar_eclipses"], |
| "properties": { |
| "d": {"type": "integer", "minimum": 1, "maximum": 31}, |
| "w": {"type": "integer", "minimum": 0, "maximum": 6}, |
| "l": {"$ref": "#/$defs/lunarDate"}, |
| "fest": {"type": "array", "items": {"type": "string"}}, |
| "terms": {"type": "array", "items": {"type": "string"}}, |
| "phases": {"type": "array", "items": {"enum": ["new_moon", "fst_qtr", "full_moon", "lst_qtr"]}}, |
| "solar_eclipses": {"type": "array", "items": {"$ref": "#/$defs/eventRef"}}, |
| "lunar_eclipses": {"type": "array", "items": {"$ref": "#/$defs/eventRef"}} |
| }, |
| "additionalProperties": false |
| }, |
| "eventRef": { |
| "type": "array", |
| "prefixItems": [{"type": "string"}, {"type": "string"}], |
| "minItems": 2, |
| "maxItems": 2 |
| }, |
| "dayDetail": { |
| "type": "object", |
| "required": ["d", "sample", "lunar", "ganzhi", "moon", "festivals", "event_indexes", "eclipse_ids", "astro_ids", "huangli"], |
| "properties": { |
| "d": {"type": "integer"}, |
| "sample": {"type": "object"}, |
| "lunar": {"$ref": "#/$defs/lunarDate"}, |
| "ganzhi": {"type": "array", "minItems": 3, "maxItems": 3, "items": {"type": "integer", "minimum": 0, "maximum": 59}}, |
| "moon": {"type": "object"}, |
| "festivals": {"type": "array", "items": {"type": "string"}}, |
| "event_indexes": {"type": "array", "items": {"type": "integer", "minimum": 0}}, |
| "eclipse_ids": {"type": "array", "items": {"type": "string"}}, |
| "astro_ids": {"type": "array", "items": {"type": "string"}}, |
| "huangli": { |
| "type": "object", |
| "required": ["common", "profiles"], |
| "properties": { |
| "common": {"type": "object"}, |
| "profiles": { |
| "type": "object", |
| "required": ["folk", "ziping", "purple", "xieji"], |
| "properties": { |
| "folk": {"type": "object"}, |
| "ziping": {"type": "object"}, |
| "purple": {"type": "object"}, |
| "xieji": {"type": "object"} |
| }, |
| "additionalProperties": false |
| } |
| }, |
| "additionalProperties": false |
| } |
| }, |
| "additionalProperties": false |
| }, |
| "calendarMonth": { |
| "type": "object", |
| "required": ["v", "y", "m", "meta", "days", "events", "detail"], |
| "properties": { |
| "v": {"const": 1}, |
| "y": {"type": "integer", "minimum": 1950, "maximum": 17000}, |
| "m": {"type": "integer", "minimum": 1, "maximum": 12}, |
| "meta": {"type": "object"}, |
| "days": {"type": "array", "items": {"$ref": "#/$defs/daySummary"}}, |
| "events": {"type": "array", "items": {"$ref": "#/$defs/preciseEvent"}}, |
| "detail": {"type": "array", "items": {"$ref": "#/$defs/dayDetail"}} |
| }, |
| "additionalProperties": false |
| }, |
| "eclipseYear": { |
| "type": "object", |
| "required": ["v", "y", "timezone", "date_assignment", "events"], |
| "properties": { |
| "v": {"const": 1}, |
| "y": {"type": "integer"}, |
| "timezone": {"const": "+08:00"}, |
| "date_assignment": {"const": "maximum_eclipse_local_civil_date"}, |
| "events": {"type": "array", "items": {"type": "object"}} |
| }, |
| "additionalProperties": false |
| }, |
| "astroMonth": { |
| "type": "object", |
| "required": ["v", "y", "m", "observer", "events"], |
| "properties": { |
| "v": {"const": 1}, |
| "y": {"type": "integer"}, |
| "m": {"type": "integer", "minimum": 1, "maximum": 12}, |
| "observer": {"type": ["object", "null"]}, |
| "events": {"type": "array", "items": {"type": "object"}} |
| }, |
| "additionalProperties": false |
| } |
| } |
| } |
|
|