{
 "$schema": "http://json-schema.org/draft-07/schema#",
 "$id": "https://zodiac.mengstone.com/data/schema.json",
 "title": "ZODIAC sky.json",
 "description": "星轨终端当日星历快照。字段变更会在此同步，版本号见 version。",
 "type": "object",
 "required": [
  "generated_at",
  "date",
  "planets",
  "moon",
  "aspects",
  "scores"
 ],
 "properties": {
  "version": {
   "type": "integer",
   "description": "schema 版本，目前为 1"
  },
  "generated_at": {
   "type": "string",
   "description": "生成时刻，UTC ISO 8601"
  },
  "date": {
   "type": "string",
   "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
  },
  "planets": {
   "type": "array",
   "minItems": 10,
   "items": {
    "type": "object",
    "required": [
     "key",
     "zh",
     "lon",
     "sign",
     "sign_zh",
     "deg",
     "retro"
    ],
    "properties": {
     "key": {
      "type": "string"
     },
     "zh": {
      "type": "string"
     },
     "lon": {
      "type": "number",
      "minimum": 0,
      "exclusiveMaximum": 360,
      "description": "黄经，ECT 真黄道"
     },
     "sign": {
      "type": "string"
     },
     "sign_zh": {
      "type": "string"
     },
     "deg": {
      "type": "number",
      "minimum": 0,
      "exclusiveMaximum": 30
     },
     "retro": {
      "type": "boolean"
     }
    }
   }
  },
  "moon": {
   "type": "object",
   "required": [
    "sign_zh",
    "deg",
    "phase"
   ],
   "properties": {
    "sign_zh": {
     "type": "string"
    },
    "deg": {
     "type": "number",
     "minimum": 0,
     "exclusiveMaximum": 30
    },
    "phase": {
     "type": "object",
     "required": [
      "name",
      "illum"
     ],
     "properties": {
      "name": {
       "type": "string"
      },
      "illum": {
       "type": "number",
       "minimum": 0,
       "maximum": 100
      }
     }
    }
   }
  },
  "aspects": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "p1",
     "p2",
     "type",
     "orb"
    ],
    "properties": {
     "p1": {
      "type": "string",
      "description": "第一颗行星的 key"
     },
     "p1_zh": {
      "type": "string"
     },
     "p2": {
      "type": "string",
      "description": "第二颗行星的 key"
     },
     "p2_zh": {
      "type": "string"
     },
     "type": {
      "type": "string",
      "description": "相位英文 key，如 sextile"
     },
     "type_zh": {
      "type": "string"
     },
     "kind": {
      "type": "string",
      "enum": [
       "soft",
       "hard",
       "conj"
      ]
     },
     "orb": {
      "type": "number",
      "minimum": 0
     },
     "sep": {
      "type": "number",
      "minimum": 0,
      "maximum": 180
     }
    }
   }
  },
  "scores": {
   "type": "object",
   "description": "12 星座当日指数（相对排序，非概率）",
   "additionalProperties": {
    "type": "object",
    "properties": {
     "overall": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
     },
     "love": {
      "type": "integer"
     },
     "career": {
      "type": "integer"
     },
     "money": {
      "type": "integer"
     },
     "relation": {
      "type": "string"
     },
     "relation_zh": {
      "type": "string"
     }
    }
   }
  }
 }
}