{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://publedge.org/schema/json/record.schema.json",
  "title": "PubLedge record.json",
  "description": "JSON shape returned by the `.json` endpoint on each PubLedge record page.",
  "type": "object",
  "required": [
    "@context",
    "meta",
    "record",
    "jsonld"
  ],
  "properties": {
    "@context": {
      "type": "string",
      "format": "uri"
    },
    "meta": {
      "type": "object",
      "required": [
        "canonical_url",
        "generated"
      ],
      "properties": {
        "canonical_url": {
          "type": "string",
          "format": "uri"
        },
        "generated": {
          "type": "string",
          "format": "date-time"
        },
        "schema": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": true
    },
    "record": {
      "type": "object",
      "required": [
        "id",
        "type",
        "authority",
        "jurisdiction",
        "url",
        "status",
        "editorial_status"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable identifier matching the record frontmatter id."
        },
        "legacy_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "official_ref": {
          "type": [
            "string",
            "null"
          ]
        },
        "instance": {
          "type": [
            "string",
            "null"
          ]
        },
        "slug": {
          "type": [
            "string",
            "null"
          ]
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "rma",
            "jia",
            "statute",
            "advisory-opinion",
            "interpretive-letter",
            "private-letter-ruling",
            "no-action-letter"
          ]
        },
        "jurisdiction": {
          "type": [
            "string",
            "null"
          ],
          "description": "ISO-like jurisdiction (e.g. us-ut, us)."
        },
        "authority": {
          "type": [
            "string",
            "null"
          ],
          "description": "Authority slug (e.g. utah-oaip, cfpb, irs-chief-counsel)."
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "issued_by": {
          "type": [
            "object",
            "string",
            "array",
            "null"
          ]
        },
        "enacted": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "effective": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "official_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "obligation_kind": {
          "type": [
            "array",
            "string",
            "null"
          ],
          "items": {
            "type": "string",
            "enum": [
              "requirement",
              "restriction",
              "permission"
            ]
          }
        },
        "reliance_scope": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "public",
            "similarly-situated-third-parties",
            "requesting-party-only"
          ]
        },
        "parties": {
          "type": [
            "array",
            "string",
            "null"
          ]
        },
        "statute_anchors": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "string"
            ]
          }
        },
        "publication_citations": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "string"
            ]
          }
        },
        "terms": {
          "type": [
            "array",
            "string",
            "null"
          ]
        },
        "status": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "proposed",
            "enacted",
            "enforcing",
            "phased-enforcement",
            "pending-replacement",
            "expired",
            "superseded",
            "withdrawn",
            "terminated"
          ]
        },
        "editorial_status": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "draft",
            "reviewed",
            "published"
          ]
        },
        "supersedes": {
          "type": [
            "string",
            "null"
          ]
        },
        "superseded_by": {
          "type": [
            "string",
            "null"
          ]
        },
        "authority_response": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "object",
            "required": [
              "from",
              "date",
              "position"
            ],
            "properties": {
              "from": {
                "type": "string"
              },
              "date": {
                "type": "string",
                "format": "date"
              },
              "position": {
                "type": "string",
                "enum": [
                  "concurs",
                  "disputes",
                  "clarifies",
                  "declines-to-comment",
                  "superseded-by-official"
                ]
              },
              "statement": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "source": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri"
              },
              "signature": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "additionalProperties": true,
            "anyOf": [
              {
                "required": [
                  "statement"
                ]
              },
              {
                "required": [
                  "source"
                ]
              }
            ]
          }
        },
        "last_verified": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "timeline": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "source_documents": {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      },
      "additionalProperties": true
    },
    "jsonld": {
      "type": "object",
      "required": [
        "@context",
        "@type"
      ],
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}