{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "info": {
    "title": "Markets Open Trading-day API",
    "version": "1.0.2-preview",
    "description": "Preview, not a live-session service. false = confirmed closed; null = unknown; HTTP error = no answer. Date-independent version metadata is shared by HTML and API."
  },
  "servers": [
    {
      "url": "https://marketsopen.today"
    }
  ],
  "paths": {
    "/api/v1/schedules": {
      "get": {
        "operationId": "defaultSchedules",
        "summary": "Common-product local-date intervals; strict venue status is separate",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "ISO calendar-date label, NOT an instant. Defaults to today in Asia/Shanghai for every endpoint.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "market",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "SGX",
                "CME",
                "ICE"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source-backed response; unknowns are explicit. Preview has no SLA.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DefaultSchedulesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or unsupported point-in-time request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown endpoint/market",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Evaluation rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Unresolved source conflict or unavailable limiter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/status": {
      "get": {
        "operationId": "allMarketStatus",
        "summary": "All markets for one date",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "ISO calendar-date label, NOT an instant. Defaults to today in Asia/Shanghai for every endpoint.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source-backed response; unknowns are explicit. Preview has no SLA.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AllStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or unsupported point-in-time request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown endpoint/market",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Evaluation rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Unresolved source conflict or unavailable limiter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/markets/{id}/status": {
      "get": {
        "operationId": "marketStatus",
        "summary": "One scoped market, including recovery context",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Case-insensitive registered scoped-market ID.",
            "schema": {
              "type": "string",
              "enum": [
                "SHFE",
                "INE",
                "DCE",
                "CZCE",
                "GFEX",
                "SSE",
                "SZSE",
                "HKEX",
                "SGX",
                "LME",
                "CME",
                "ICE"
              ]
            }
          },
          {
            "name": "date",
            "in": "query",
            "description": "ISO calendar-date label, NOT an instant. Defaults to today in Asia/Shanghai for every endpoint.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source-backed response; unknowns are explicit. Preview has no SLA.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or unsupported point-in-time request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown endpoint/market",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Evaluation rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Unresolved source conflict or unavailable limiter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/markets/{id}/holidays": {
      "get": {
        "operationId": "marketHolidays",
        "summary": "Named annual holidays; ordinary weekends excluded",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Case-insensitive registered scoped-market ID.",
            "schema": {
              "type": "string",
              "enum": [
                "SHFE",
                "INE",
                "DCE",
                "CZCE",
                "GFEX",
                "SSE",
                "SZSE",
                "HKEX",
                "SGX",
                "LME",
                "CME",
                "ICE"
              ]
            }
          },
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 2024,
              "maximum": 2028
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source-backed response; unknowns are explicit. Preview has no SLA.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HolidaysResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or unsupported point-in-time request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown endpoint/market",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Evaluation rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Unresolved source conflict or unavailable limiter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/markets/{id}/next-closure": {
      "get": {
        "operationId": "nextClosure",
        "summary": "Next closed date or NEW named closure; current recovery context is separate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Case-insensitive registered scoped-market ID.",
            "schema": {
              "type": "string",
              "enum": [
                "SHFE",
                "INE",
                "DCE",
                "CZCE",
                "GFEX",
                "SSE",
                "SZSE",
                "HKEX",
                "SGX",
                "LME",
                "CME",
                "ICE"
              ]
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "ISO calendar-date label, NOT an instant. Defaults to today in Asia/Shanghai for every endpoint.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "any",
                "holiday"
              ],
              "default": "any"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source-backed response; unknowns are explicit. Preview has no SLA.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NextClosureResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or unsupported point-in-time request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown endpoint/market",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Evaluation rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Unresolved source conflict or unavailable limiter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/changelog": {
      "get": {
        "operationId": "changelog",
        "summary": "Recorded dataset revisions, inclusive since date",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "description": "ISO calendar-date label, NOT an instant. Defaults to today in Asia/Shanghai for every endpoint.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source-backed response; unknowns are explicit. Preview has no SLA.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangelogResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or unsupported point-in-time request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown endpoint/market",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Evaluation rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Unresolved source conflict or unavailable limiter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "NightSession": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "basis",
          "has",
          "reason",
          "trading_date",
          "civil_date"
        ],
        "properties": {
          "basis": {
            "type": "string",
            "enum": [
              "civil_evening",
              "trading_date"
            ]
          },
          "has": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "trading_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "civil_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "applies_to": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "FieldProvenance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source_ids",
          "source_urls",
          "notice_ids",
          "derivation",
          "source_checked_at",
          "verified_at"
        ],
        "properties": {
          "source_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source_urls": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "notice_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "derivation": {
            "type": "string"
          },
          "source_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          }
        }
      },
      "NoticeHealth": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "market_id",
          "monitoring_state",
          "last_attempt_at",
          "last_success_at",
          "last_attempt_status",
          "pending_relevant",
          "age_hours",
          "max_age_hours",
          "scan_scope",
          "is_live_feed"
        ],
        "properties": {
          "market_id": {
            "type": "string"
          },
          "monitoring_state": {
            "type": "string",
            "enum": [
              "not_configured",
              "not_run",
              "scan_failed",
              "review_required",
              "stale",
              "current"
            ]
          },
          "last_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_success_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_attempt_status": {
            "type": "string"
          },
          "pending_relevant": {
            "type": "integer",
            "minimum": 0
          },
          "age_hours": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "max_age_hours": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "scan_scope": {
            "const": "configured_notice_indexes_only"
          },
          "is_live_feed": {
            "const": false
          }
        }
      },
      "ScheduleContext": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "market_id",
          "date",
          "mode",
          "closure_start",
          "closure_end",
          "reopens_on",
          "night_resumes_on",
          "night_trading_date",
          "next_holiday_on",
          "next_no_night_on",
          "source_urls",
          "coverage_end"
        ],
        "properties": {
          "market_id": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "mode": {
            "type": "string",
            "enum": [
              "unverified",
              "closed",
              "no_night",
              "trading_day"
            ]
          },
          "closure_start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "closure_end": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "reopens_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "night_resumes_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "night_trading_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "next_holiday_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "next_no_night_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "source_urls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "coverage_end": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "SourceRecord": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "publisher",
          "title",
          "url",
          "source_type",
          "source_checked_at",
          "check_method",
          "verified_at",
          "verified_by",
          "review_state",
          "rights_status"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "publisher": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "source_type": {
            "type": "string",
            "enum": [
              "official",
              "secondary"
            ]
          },
          "source_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "check_method": {
            "type": [
              "string",
              "null"
            ]
          },
          "verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "verified_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "review_state": {
            "type": "string",
            "enum": [
              "draft",
              "pending",
              "imported",
              "source_checked",
              "verified"
            ]
          },
          "rights_status": {
            "type": "string"
          },
          "published_at": {
            "type": "string",
            "format": "date"
          },
          "notes": {
            "type": "string"
          }
        }
      },
      "ChangeRecord": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "recorded_at",
          "kind",
          "markets",
          "affected_start",
          "affected_end",
          "source_ids",
          "summary",
          "sources"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "recorded_at": {
            "type": "string",
            "format": "date"
          },
          "kind": {
            "type": "string"
          },
          "markets": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "affected_start": {
            "type": "string",
            "format": "date"
          },
          "affected_end": {
            "type": "string",
            "format": "date"
          },
          "source_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "summary": {
            "type": "string"
          },
          "zh": {
            "type": "string"
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceRecord"
            }
          }
        }
      },
      "MarketDayRecord": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "market_id",
          "date",
          "scope",
          "scope_label",
          "time_zone",
          "status",
          "is_trading_day",
          "night_session",
          "incoming_night_session",
          "settlement",
          "settlement_status",
          "reason",
          "reason_zh",
          "holiday_id",
          "adjusted_workday",
          "notes",
          "review_state",
          "source_type",
          "source_url",
          "discovery_url",
          "source_id",
          "source_checked_at",
          "check_method",
          "verified_at",
          "changed_at",
          "changed_by_notice",
          "rights_status",
          "field_provenance",
          "source_urls",
          "audit_notice_ids",
          "applied_notice_ids",
          "data_version",
          "coverage_start",
          "coverage_end"
        ],
        "properties": {
          "market_id": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "scope": {
            "type": "string"
          },
          "scope_label": {
            "type": "string"
          },
          "time_zone": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "closed",
              "half_day",
              "irregular",
              "unknown"
            ]
          },
          "is_trading_day": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "night_session": {
            "$ref": "#/components/schemas/NightSession"
          },
          "incoming_night_session": {
            "$ref": "#/components/schemas/NightSession"
          },
          "settlement": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Independent clearing-calendar evidence required; null is NOT false."
          },
          "settlement_status": {
            "type": "string"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason_zh": {
            "type": [
              "string",
              "null"
            ]
          },
          "holiday_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "adjusted_workday": {
            "type": "boolean"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "review_state": {
            "type": "string",
            "enum": [
              "draft",
              "pending",
              "imported",
              "source_checked",
              "verified"
            ]
          },
          "source_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "official",
              "secondary",
              null
            ]
          },
          "source_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "discovery_url": {
            "type": "string",
            "format": "uri"
          },
          "source_id": {
            "type": "string"
          },
          "source_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "check_method": {
            "type": [
              "string",
              "null"
            ]
          },
          "verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Human sign-off only, not a source-fetch timestamp."
          },
          "changed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "changed_by_notice": {
            "type": [
              "string",
              "null"
            ]
          },
          "rights_status": {
            "type": "string"
          },
          "field_provenance": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status",
              "is_trading_day",
              "night_session",
              "incoming_night_session",
              "settlement"
            ],
            "properties": {
              "status": {
                "$ref": "#/components/schemas/FieldProvenance"
              },
              "is_trading_day": {
                "$ref": "#/components/schemas/FieldProvenance"
              },
              "night_session": {
                "$ref": "#/components/schemas/FieldProvenance"
              },
              "incoming_night_session": {
                "$ref": "#/components/schemas/FieldProvenance"
              },
              "settlement": {
                "$ref": "#/components/schemas/FieldProvenance"
              }
            }
          },
          "source_urls": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "audit_notice_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "applied_notice_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "data_version": {
            "type": "string"
          },
          "coverage_start": {
            "type": "string",
            "format": "date"
          },
          "coverage_end": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "NextClosureRecord": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "market_id",
          "date",
          "scope",
          "scope_label",
          "time_zone",
          "status",
          "is_trading_day",
          "night_session",
          "incoming_night_session",
          "settlement",
          "settlement_status",
          "reason",
          "reason_zh",
          "holiday_id",
          "adjusted_workday",
          "notes",
          "review_state",
          "source_type",
          "source_url",
          "discovery_url",
          "source_id",
          "source_checked_at",
          "check_method",
          "verified_at",
          "changed_at",
          "changed_by_notice",
          "rights_status",
          "field_provenance",
          "source_urls",
          "audit_notice_ids",
          "applied_notice_ids",
          "data_version",
          "coverage_start",
          "coverage_end",
          "days_away"
        ],
        "properties": {
          "market_id": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "scope": {
            "type": "string"
          },
          "scope_label": {
            "type": "string"
          },
          "time_zone": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "closed",
              "half_day",
              "irregular",
              "unknown"
            ]
          },
          "is_trading_day": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "night_session": {
            "$ref": "#/components/schemas/NightSession"
          },
          "incoming_night_session": {
            "$ref": "#/components/schemas/NightSession"
          },
          "settlement": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "settlement_status": {
            "type": "string"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason_zh": {
            "type": [
              "string",
              "null"
            ]
          },
          "holiday_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "adjusted_workday": {
            "type": "boolean"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "review_state": {
            "type": "string",
            "enum": [
              "draft",
              "pending",
              "imported",
              "source_checked",
              "verified"
            ]
          },
          "source_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "official",
              "secondary",
              null
            ]
          },
          "source_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "discovery_url": {
            "type": "string",
            "format": "uri"
          },
          "source_id": {
            "type": "string"
          },
          "source_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "check_method": {
            "type": [
              "string",
              "null"
            ]
          },
          "verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "changed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "changed_by_notice": {
            "type": [
              "string",
              "null"
            ]
          },
          "rights_status": {
            "type": "string"
          },
          "field_provenance": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status",
              "is_trading_day",
              "night_session",
              "incoming_night_session",
              "settlement"
            ],
            "properties": {
              "status": {
                "$ref": "#/components/schemas/FieldProvenance"
              },
              "is_trading_day": {
                "$ref": "#/components/schemas/FieldProvenance"
              },
              "night_session": {
                "$ref": "#/components/schemas/FieldProvenance"
              },
              "incoming_night_session": {
                "$ref": "#/components/schemas/FieldProvenance"
              },
              "settlement": {
                "$ref": "#/components/schemas/FieldProvenance"
              }
            }
          },
          "source_urls": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "audit_notice_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "applied_notice_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "data_version": {
            "type": "string"
          },
          "coverage_start": {
            "type": "string",
            "format": "date"
          },
          "coverage_end": {
            "type": "string",
            "format": "date"
          },
          "days_away": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "AllStatusResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schema_version",
          "engine_version",
          "data_version",
          "date_basis",
          "default_date_zone",
          "human_verification_complete",
          "point_in_time_supported",
          "monitoring",
          "date",
          "china",
          "coverage_status",
          "markets"
        ],
        "properties": {
          "schema_version": {
            "const": "1.0.2-preview"
          },
          "engine_version": {
            "type": "string"
          },
          "data_version": {
            "type": "string"
          },
          "date_basis": {
            "const": "calendar_date_label"
          },
          "default_date_zone": {
            "const": "Asia/Shanghai"
          },
          "human_verification_complete": {
            "type": "boolean"
          },
          "point_in_time_supported": {
            "const": false
          },
          "monitoring": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NoticeHealth"
            }
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "china": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status",
              "total",
              "covered",
              "pending",
              "complete",
              "open",
              "closed"
            ],
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "unknown",
                  "closed",
                  "open",
                  "mixed"
                ]
              },
              "total": {
                "type": "integer"
              },
              "covered": {
                "type": "integer"
              },
              "pending": {
                "type": "integer"
              },
              "complete": {
                "type": "boolean"
              },
              "open": {
                "type": "integer"
              },
              "closed": {
                "type": "integer"
              }
            }
          },
          "coverage_status": {
            "type": "string",
            "enum": [
              "partial",
              "complete"
            ]
          },
          "markets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketDayRecord"
            }
          }
        }
      },
      "MarketStatusResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schema_version",
          "engine_version",
          "data_version",
          "date_basis",
          "default_date_zone",
          "human_verification_complete",
          "point_in_time_supported",
          "monitoring",
          "date",
          "schedule_context",
          "record"
        ],
        "properties": {
          "schema_version": {
            "const": "1.0.2-preview"
          },
          "engine_version": {
            "type": "string"
          },
          "data_version": {
            "type": "string"
          },
          "date_basis": {
            "const": "calendar_date_label"
          },
          "default_date_zone": {
            "const": "Asia/Shanghai"
          },
          "human_verification_complete": {
            "type": "boolean"
          },
          "point_in_time_supported": {
            "const": false
          },
          "monitoring": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NoticeHealth"
            }
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "schedule_context": {
            "$ref": "#/components/schemas/ScheduleContext"
          },
          "record": {
            "$ref": "#/components/schemas/MarketDayRecord"
          }
        }
      },
      "HolidaysResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schema_version",
          "engine_version",
          "data_version",
          "date_basis",
          "default_date_zone",
          "human_verification_complete",
          "point_in_time_supported",
          "monitoring",
          "market_id",
          "year",
          "scope",
          "coverage",
          "review_state",
          "holidays",
          "half_days"
        ],
        "properties": {
          "schema_version": {
            "const": "1.0.2-preview"
          },
          "engine_version": {
            "type": "string"
          },
          "data_version": {
            "type": "string"
          },
          "date_basis": {
            "const": "calendar_date_label"
          },
          "default_date_zone": {
            "const": "Asia/Shanghai"
          },
          "human_verification_complete": {
            "type": "boolean"
          },
          "point_in_time_supported": {
            "const": false
          },
          "monitoring": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NoticeHealth"
            }
          },
          "market_id": {
            "type": "string"
          },
          "year": {
            "type": "integer"
          },
          "scope": {
            "type": "string"
          },
          "coverage": {
            "type": "string",
            "enum": [
              "loaded",
              "not_loaded"
            ]
          },
          "review_state": {
            "type": "string",
            "enum": [
              "draft",
              "pending",
              "imported",
              "source_checked",
              "verified"
            ]
          },
          "holidays": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "name",
                "zh",
                "start",
                "end",
                "record"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "zh": {
                  "type": "string"
                },
                "start": {
                  "type": "string",
                  "format": "date"
                },
                "end": {
                  "type": "string",
                  "format": "date"
                },
                "record": {
                  "$ref": "#/components/schemas/MarketDayRecord"
                }
              }
            }
          },
          "half_days": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "date",
                "name"
              ],
              "properties": {
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "name": {
                  "type": "string"
                },
                "zh": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "NextClosureResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schema_version",
          "engine_version",
          "data_version",
          "date_basis",
          "default_date_zone",
          "human_verification_complete",
          "point_in_time_supported",
          "monitoring",
          "market_id",
          "after",
          "kind",
          "schedule_context",
          "record",
          "coverage_status",
          "note"
        ],
        "properties": {
          "schema_version": {
            "const": "1.0.2-preview"
          },
          "engine_version": {
            "type": "string"
          },
          "data_version": {
            "type": "string"
          },
          "date_basis": {
            "const": "calendar_date_label"
          },
          "default_date_zone": {
            "const": "Asia/Shanghai"
          },
          "human_verification_complete": {
            "type": "boolean"
          },
          "point_in_time_supported": {
            "const": false
          },
          "monitoring": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NoticeHealth"
            }
          },
          "market_id": {
            "type": "string"
          },
          "after": {
            "type": "string",
            "format": "date"
          },
          "kind": {
            "type": "string",
            "enum": [
              "any",
              "holiday"
            ]
          },
          "schedule_context": {
            "$ref": "#/components/schemas/ScheduleContext"
          },
          "record": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/NextClosureRecord"
              },
              {
                "type": "null"
              }
            ]
          },
          "coverage_status": {
            "type": "string",
            "enum": [
              "found",
              "not_found_in_loaded_coverage"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ChangelogResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schema_version",
          "engine_version",
          "data_version",
          "date_basis",
          "default_date_zone",
          "human_verification_complete",
          "point_in_time_supported",
          "since",
          "changes"
        ],
        "properties": {
          "schema_version": {
            "const": "1.0.2-preview"
          },
          "engine_version": {
            "type": "string"
          },
          "data_version": {
            "type": "string"
          },
          "date_basis": {
            "const": "calendar_date_label"
          },
          "default_date_zone": {
            "const": "Asia/Shanghai"
          },
          "human_verification_complete": {
            "type": "boolean"
          },
          "point_in_time_supported": {
            "const": false
          },
          "since": {
            "type": "string",
            "format": "date"
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChangeRecord"
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error",
          "data_version"
        ],
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          },
          "data_version": {
            "type": "string"
          }
        }
      },
      "DefaultSchedule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "market_id",
          "date",
          "date_basis",
          "scope",
          "scope_label",
          "scope_label_zh",
          "products",
          "time_zone",
          "zone_label",
          "zone_label_zh",
          "status",
          "has_scheduled_session",
          "schedule_complete",
          "regular_hours",
          "regular_hours_zh",
          "sessions",
          "session_groups",
          "reason",
          "reason_zh",
          "exception_note",
          "exception_note_zh",
          "calendar_source",
          "regular_source_url",
          "source_urls",
          "coverage_start",
          "coverage_end",
          "default_schedule_data_version",
          "is_live_status",
          "human_verification_complete",
          "settlement"
        ],
        "properties": {
          "market_id": {
            "enum": [
              "SGX",
              "CME",
              "ICE"
            ]
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "date_basis": {
            "const": "local_calendar_schedule"
          },
          "scope": {
            "type": "string"
          },
          "scope_label": {
            "type": "string"
          },
          "scope_label_zh": {
            "type": "string"
          },
          "products": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "time_zone": {
            "type": "string"
          },
          "zone_label": {
            "type": "string"
          },
          "zone_label_zh": {
            "type": "string"
          },
          "status": {
            "enum": [
              "scheduled",
              "adjusted",
              "overnight_only",
              "evening_open",
              "unconfirmed",
              "closed"
            ]
          },
          "has_scheduled_session": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "schedule_complete": {
            "type": "boolean"
          },
          "regular_hours": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "regular_hours_zh": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sessions": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "start",
                "end",
                "session_anchor_date"
              ],
              "properties": {
                "start": {
                  "type": "string",
                  "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                },
                "end": {
                  "type": "string",
                  "pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                },
                "session_anchor_date": {
                  "type": "string",
                  "format": "date"
                }
              }
            }
          },
          "session_groups": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "name",
                "name_zh",
                "products",
                "sessions"
              ],
              "properties": {
                "name": {
                  "type": "string"
                },
                "name_zh": {
                  "type": "string"
                },
                "products": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "sessions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "start",
                      "end",
                      "session_anchor_date"
                    ],
                    "properties": {
                      "start": {
                        "type": "string",
                        "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                      },
                      "end": {
                        "type": "string",
                        "pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
                      },
                      "session_anchor_date": {
                        "type": "string",
                        "format": "date"
                      }
                    }
                  }
                }
              }
            }
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason_zh": {
            "type": [
              "string",
              "null"
            ]
          },
          "exception_note": {
            "type": "string"
          },
          "exception_note_zh": {
            "type": "string"
          },
          "calendar_source": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "source_type",
              "source_checked_at",
              "verified_at",
              "verified_by",
              "rights_status",
              "url",
              "notes"
            ],
            "properties": {
              "source_type": {
                "type": "string",
                "enum": [
                  "official",
                  "inherited_repository"
                ]
              },
              "source_checked_at": {
                "type": "string",
                "format": "date"
              },
              "verified_at": {
                "type": "null"
              },
              "verified_by": {
                "type": "null"
              },
              "rights_status": {
                "const": "pending_review"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "notes": {
                "type": "string"
              },
              "upstream_commit": {
                "type": "string",
                "pattern": "^[a-f0-9]{40}$"
              },
              "sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            }
          },
          "regular_source_url": {
            "type": "string",
            "format": "uri"
          },
          "source_urls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "coverage_start": {
            "type": "string",
            "format": "date"
          },
          "coverage_end": {
            "type": "string",
            "format": "date"
          },
          "default_schedule_data_version": {
            "const": "2026.09.28.1"
          },
          "is_live_status": {
            "const": false
          },
          "human_verification_complete": {
            "const": false
          },
          "settlement": {
            "type": "null"
          }
        }
      },
      "DefaultSchedulesResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schema_version",
          "engine_version",
          "data_version",
          "date_basis",
          "default_date_zone",
          "human_verification_complete",
          "point_in_time_supported",
          "date",
          "default_schedule_data_version",
          "defaults"
        ],
        "properties": {
          "schema_version": {
            "const": "1.0.2-preview"
          },
          "engine_version": {
            "type": "string"
          },
          "data_version": {
            "type": "string"
          },
          "date_basis": {
            "const": "local_calendar_schedule"
          },
          "default_date_zone": {
            "const": "Asia/Shanghai"
          },
          "human_verification_complete": {
            "type": "boolean"
          },
          "point_in_time_supported": {
            "const": false
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "default_schedule_data_version": {
            "const": "2026.09.28.1"
          },
          "defaults": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DefaultSchedule"
            }
          }
        }
      }
    }
  },
  "x-data-version": "2026.09.28-rc.4"
}