{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/chinafootnotes-com/json-schema/chinafootnotes-com-place-list-schema.json",
  "title": "PlaceList",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/chinafootnotes-com-openapi.yml#/components/schemas/PlaceList",
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string"
    },
    "version": {
      "type": "string"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "notice": {
      "type": "string"
    },
    "total": {
      "type": "integer"
    },
    "places": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Place"
      }
    }
  },
  "required": [
    "total",
    "places"
  ],
  "$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"
      ]
    },
    "Field": {
      "type": "object",
      "properties": {
        "value": {
          "type": [
            "string",
            "null"
          ],
          "description": "May contain explanation even when status is unknown or conflicting. Never infer confirmation from nonempty value."
        },
        "status": {
          "type": "string",
          "enum": [
            "source_checked",
            "unknown",
            "conflicting",
            "not_applicable"
          ],
          "description": "source_checked = a published source was read, or we phoned the venue, read its sign on site or tried it ourselves (see the source kind); not confirmed for today. not_applicable means no single policy covers this scoped place; it does not mean free or no booking."
        },
        "sourceIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "value",
        "status",
        "sourceIds"
      ]
    },
    "Photo": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string"
        },
        "author": {
          "type": "string"
        },
        "license": {
          "type": "string"
        },
        "licenseUrl": {
          "type": "string"
        },
        "caption": {
          "type": "string"
        },
        "alt": {
          "type": "string"
        },
        "accessedAt": {
          "type": "string",
          "format": "date"
        }
      },
      "required": [
        "url",
        "sourceUrl",
        "author",
        "license"
      ]
    },
    "Place": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "localName": {
          "type": "string"
        },
        "district": {
          "type": [
            "string",
            "null"
          ],
          "description": "District name; null where not collected yet."
        },
        "summary": {
          "type": "string"
        },
        "number": {
          "type": "integer",
          "minimum": 1,
          "description": "1–50 are Shanghai; other cities are numbered from 51."
        },
        "category": {
          "type": "string",
          "enum": [
            "Landmarks",
            "Museums",
            "Neighborhoods",
            "Gardens",
            "Temples",
            "Water towns"
          ]
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "visitDuration": {
          "type": [
            "string",
            "null"
          ],
          "description": "Editorial planning suggestion, not a venue rule."
        },
        "researchedAt": {
          "type": "string",
          "format": "date"
        },
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Source"
          }
        },
        "tips": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Tip"
          }
        },
        "photos": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Photo"
          }
        },
        "updates": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Update"
          }
        },
        "dataQuality": {
          "type": "object",
          "properties": {
            "knownFields": {
              "type": "integer"
            },
            "totalFields": {
              "type": "integer"
            },
            "method": {
              "type": "string"
            },
            "reviewDue": {
              "type": "string",
              "format": "date"
            }
          },
          "required": []
        },
        "sourceMonitoring": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SourceMonitoring"
          }
        },
        "hasPendingSourceReview": {
          "type": "boolean"
        },
        "isReviewOverdue": {
          "type": "boolean"
        },
        "address": {
          "$ref": "#/$defs/Field"
        },
        "transport": {
          "$ref": "#/$defs/Field"
        },
        "hours": {
          "$ref": "#/$defs/Field"
        },
        "admission": {
          "$ref": "#/$defs/Field"
        },
        "booking": {
          "$ref": "#/$defs/Field"
        },
        "foreignVisitors": {
          "$ref": "#/$defs/Field"
        },
        "accessibility": {
          "$ref": "#/$defs/Field"
        },
        "lastAdmission": {
          "$ref": "#/$defs/Field"
        },
        "city": {
          "type": "string",
          "description": "City id, e.g. shanghai"
        },
        "area": {
          "type": [
            "string",
            "null"
          ],
          "description": "Area id within the city (see City.areas)"
        },
        "group": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "town",
            "trips",
            null
          ],
          "description": "For cities split into In town and Day trips (see City.groups)"
        },
        "distanceKm": {
          "type": [
            "number",
            "null"
          ],
          "description": "Day trips only: rough distance from the centre; null when not checked"
        },
        "shortName": {
          "type": "string",
          "description": "Short label for maps and lists"
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Event"
          }
        }
      },
      "required": [
        "id",
        "name",
        "localName",
        "category",
        "summary",
        "highlights",
        "researchedAt",
        "sources",
        "tips",
        "photos",
        "updates"
      ]
    },
    "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"
      ]
    },
    "SourceMonitoring": {
      "type": "object",
      "properties": {
        "sourceId": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "not_checked",
            "baseline",
            "unchanged",
            "changed",
            "failed",
            "alive"
          ]
        },
        "lastSuccessAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lastAttemptAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "pendingReviewIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "sourceId",
        "status",
        "pendingReviewIds"
      ]
    },
    "Tip": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        },
        "topic": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "const": "traveler_report"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "sourceTitle": {
          "type": "string"
        },
        "author": {
          "type": "string"
        },
        "observedDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "observedDateRaw": {
          "type": [
            "string",
            "null"
          ],
          "description": "Original visible date label. It can lack a year or include locale text; never manufacture a year."
        },
        "visitDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "accessedAt": {
          "type": "string",
          "format": "date"
        },
        "caveat": {
          "type": "string"
        },
        "commercial": {
          "type": "boolean"
        }
      },
      "required": [
        "text",
        "kind",
        "sourceUrl",
        "accessedAt"
      ]
    },
    "Update": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "publishedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "reviewedAt": {
          "type": "string",
          "format": "date"
        },
        "startsAt": {
          "type": "string",
          "format": "date"
        },
        "expiresAt": {
          "type": "string",
          "format": "date"
        },
        "sourceIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "placeId": {
          "type": "string"
        },
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Source"
          }
        }
      },
      "required": [
        "id",
        "text",
        "publishedAt",
        "reviewedAt",
        "startsAt",
        "expiresAt",
        "sourceIds"
      ]
    }
  }
}