{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/chinafootnotes-com/json-schema/chinafootnotes-com-event-list-schema.json",
  "title": "EventList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/chinafootnotes-com-events-api-openapi.yml#/components/schemas/EventList",
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string"
    },
    "version": {
      "type": "string"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "notice": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Event"
      }
    }
  },
  "required": [
    "events"
  ],
  "$defs": {
    "Event": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "festival",
            "exhibition",
            "show",
            "performance",
            "seasonal",
            "other"
          ]
        },
        "title": {
          "type": "string"
        },
        "startsAt": {
          "type": "string",
          "format": "date"
        },
        "endsAt": {
          "type": "string",
          "format": "date",
          "description": "Exact end date unless endsAtLabel is present; then this is only the upper bound used for filtering, not a confirmed last day."
        },
        "when": {
          "type": "string"
        },
        "where": {
          "type": "string"
        },
        "ticket": {
          "type": "string",
          "enum": [
            "free",
            "included",
            "paid",
            "unknown"
          ]
        },
        "price": {
          "type": "string"
        },
        "booking": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "sourceIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "placeId": {
          "type": "string"
        },
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Source"
          }
        },
        "dates": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "date"
          },
          "description": "Specific dates when the event runs, inside startsAt..endsAt"
        },
        "basisNotes": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "endsAtLabel": {
          "type": "string",
          "description": "Source-stated end period when the exact day is unknown. Use this label instead of presenting endsAt as an exact date."
        }
      },
      "required": [
        "id",
        "kind",
        "title",
        "endsAt",
        "text",
        "sourceIds"
      ]
    },
    "Source": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "null only for our own checks, which have no web page: kind owner_tested (we tried it ourselves; first-hand, not official) or owner_official (the venue's own answer: method phone, onsite_sign or onsite_notice; official). accessedAt is the day we checked."
        },
        "title": {
          "type": "string"
        },
        "publisher": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "official",
            "government"
          ]
        },
        "method": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "phone",
            "onsite_sign",
            "onsite_notice",
            null
          ],
          "description": "Only for kind owner_official: how we got the venue’s answer (by phone, a standing sign on site, or a temporary notice on site)."
        },
        "contact": {
          "type": [
            "string",
            "null"
          ],
          "description": "Only for method phone: who we called (venue and number)."
        },
        "accessedAt": {
          "type": "string",
          "format": "date"
        },
        "publishedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        }
      },
      "required": [
        "id",
        "url",
        "title",
        "publisher",
        "kind",
        "accessedAt"
      ]
    }
  }
}