{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/shirabe-dev/json-schema/shirabe-dev-calendar-response-schema.json",
  "title": "CalendarResponse",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/shirabe-dev-openapi.yaml#/components/schemas/CalendarResponse",
  "type": "object",
  "required": [
    "date",
    "wareki",
    "dayOfWeek",
    "kyureki",
    "rokuyo",
    "kanshi",
    "nijushiSekki",
    "rekichu",
    "context",
    "summary"
  ],
  "properties": {
    "date": {
      "type": "string",
      "format": "date"
    },
    "wareki": {
      "type": "string",
      "description": "和暦表記"
    },
    "dayOfWeek": {
      "$ref": "#/$defs/DayOfWeek"
    },
    "kyureki": {
      "$ref": "#/$defs/KyurekiDate"
    },
    "rokuyo": {
      "$ref": "#/$defs/RokuyoInfo"
    },
    "kanshi": {
      "$ref": "#/$defs/KanshiInfo"
    },
    "nijushiSekki": {
      "$ref": "#/$defs/SekkiInfo"
    },
    "rekichu": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RekichuInfo"
      }
    },
    "context": {
      "type": "object",
      "description": "用途カテゴリ（`Category`）をキーとした判定結果マップ。\n`categories` クエリで絞り込んだ場合は、その部分集合のみ返る。\nMap keyed by purpose `Category`, each value a `ContextJudgment`.\nWhen the `categories` query narrows the request, only those\nkeys are returned.\n",
      "additionalProperties": {
        "$ref": "#/$defs/ContextJudgment"
      }
    },
    "summary": {
      "type": "string",
      "description": "人間・AI どちらでも要約として使える 1 行テキスト。\nUI や AI 応答にそのまま差し込める。\nOne-line recap suitable for both human display and LLM answers.\nSafe to drop into a UI or a chat response as-is.\n"
    }
  },
  "$defs": {
    "ContextJudgment": {
      "type": "object",
      "description": "ある用途カテゴリに対する、その日の判定結果。\n`judgment` は人間が読む 7 段階のラベル、`score` は機械処理用の 1〜10 の整数。\nPurpose-specific judgment for a single date.\n`judgment` is a human-readable 7-level label; `score` is a\nmachine-friendly 1-10 integer used for ranking and filtering.\n",
      "required": [
        "judgment",
        "note",
        "score"
      ],
      "properties": {
        "judgment": {
          "$ref": "#/$defs/JudgmentValue"
        },
        "note": {
          "type": "string",
          "description": "判定理由の補足説明 / Human-readable rationale."
        },
        "score": {
          "type": "integer",
          "description": "用途に対する適性スコア（10 = 最良、1 = 最悪）/ Fitness score (10 = best).",
          "minimum": 1,
          "maximum": 10
        }
      }
    },
    "DayOfWeek": {
      "type": "object",
      "required": [
        "ja",
        "en"
      ],
      "properties": {
        "ja": {
          "type": "string"
        },
        "en": {
          "type": "string"
        }
      }
    },
    "Fortune": {
      "type": "string",
      "enum": [
        "吉",
        "凶",
        "小吉"
      ]
    },
    "JudgmentValue": {
      "type": "string",
      "description": "コンテキスト判定値",
      "enum": [
        "大吉",
        "吉",
        "小吉",
        "問題なし",
        "注意",
        "凶",
        "大凶"
      ]
    },
    "KanshiInfo": {
      "type": "object",
      "required": [
        "full",
        "jikkan",
        "junishi",
        "junishiAnimal",
        "index"
      ],
      "properties": {
        "full": {
          "type": "string",
          "description": "60干支の組み合わせ"
        },
        "jikkan": {
          "type": "string",
          "enum": [
            "甲",
            "乙",
            "丙",
            "丁",
            "戊",
            "己",
            "庚",
            "辛",
            "壬",
            "癸"
          ]
        },
        "junishi": {
          "type": "string",
          "enum": [
            "子",
            "丑",
            "寅",
            "卯",
            "辰",
            "巳",
            "午",
            "未",
            "申",
            "酉",
            "戌",
            "亥"
          ]
        },
        "junishiAnimal": {
          "type": "object",
          "required": [
            "ja",
            "en"
          ],
          "properties": {
            "ja": {
              "type": "string"
            },
            "en": {
              "type": "string"
            }
          }
        },
        "index": {
          "type": "integer",
          "minimum": 0,
          "maximum": 59
        }
      }
    },
    "KyurekiDate": {
      "type": "object",
      "description": "旧暦日付",
      "required": [
        "year",
        "month",
        "day",
        "isLeapMonth",
        "monthName"
      ],
      "properties": {
        "year": {
          "type": "integer"
        },
        "month": {
          "type": "integer",
          "minimum": 1,
          "maximum": 12
        },
        "day": {
          "type": "integer",
          "minimum": 1,
          "maximum": 30
        },
        "isLeapMonth": {
          "type": "boolean"
        },
        "monthName": {
          "type": "string",
          "enum": [
            "睦月",
            "如月",
            "弥生",
            "卯月",
            "皐月",
            "水無月",
            "文月",
            "葉月",
            "長月",
            "神無月",
            "霜月",
            "師走"
          ]
        }
      }
    },
    "RekichuInfo": {
      "type": "object",
      "required": [
        "name",
        "reading",
        "description",
        "type"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "暦注名",
          "enum": [
            "一粒万倍日",
            "天赦日",
            "大明日",
            "母倉日",
            "天恩日",
            "寅の日",
            "巳の日",
            "己巳の日",
            "甲子の日",
            "不成就日",
            "三隣亡",
            "受死日",
            "十死日"
          ]
        },
        "reading": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "吉",
            "凶"
          ]
        }
      }
    },
    "RokuyoInfo": {
      "type": "object",
      "required": [
        "name",
        "reading",
        "description",
        "timeSlots"
      ],
      "properties": {
        "name": {
          "type": "string",
          "enum": [
            "大安",
            "赤口",
            "先勝",
            "友引",
            "先負",
            "仏滅"
          ]
        },
        "reading": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "timeSlots": {
          "$ref": "#/$defs/TimeSlots"
        }
      }
    },
    "SekkiInfo": {
      "type": "object",
      "required": [
        "name",
        "reading",
        "description",
        "isToday"
      ],
      "properties": {
        "name": {
          "type": "string",
          "enum": [
            "小寒",
            "大寒",
            "立春",
            "雨水",
            "啓蟄",
            "春分",
            "清明",
            "穀雨",
            "立夏",
            "小満",
            "芒種",
            "夏至",
            "小暑",
            "大暑",
            "立秋",
            "処暑",
            "白露",
            "秋分",
            "寒露",
            "霜降",
            "立冬",
            "小雪",
            "大雪",
            "冬至"
          ]
        },
        "reading": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "isToday": {
          "type": "boolean",
          "description": "指定日が節気の当日かどうか"
        }
      }
    },
    "TimeSlots": {
      "type": "object",
      "required": [
        "morning",
        "noon",
        "afternoon",
        "evening"
      ],
      "properties": {
        "morning": {
          "$ref": "#/$defs/Fortune"
        },
        "noon": {
          "$ref": "#/$defs/Fortune"
        },
        "afternoon": {
          "$ref": "#/$defs/Fortune"
        },
        "evening": {
          "$ref": "#/$defs/Fortune"
        }
      }
    }
  }
}