{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/placestack-com/json-schema/placestack-com-case-schema.json",
  "title": "Case",
  "description": "A zoning or development case, with its decision.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/placestack-com-openapi.json#/components/schemas/Case",
  "properties": {
    "object": {
      "type": "string",
      "const": "case",
      "title": "Object",
      "description": "The object's type. Always `case`.",
      "default": "case"
    },
    "id": {
      "type": "string",
      "pattern": "^cas_[0-7][0-9a-hjkmnp-tv-z]{25}$",
      "title": "Id",
      "description": "A case id."
    },
    "number": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Number",
      "description": "Case number, as published. Null when not published."
    },
    "type": {
      "anyOf": [
        {
          "$ref": "#/$defs/Code"
        },
        {
          "type": "null"
        }
      ],
      "description": "Case type, as published: a rezoning, variance, special use, subdivision or site plan. Null when not published."
    },
    "status": {
      "anyOf": [
        {
          "$ref": "#/$defs/Code"
        },
        {
          "type": "null"
        }
      ],
      "description": "Status, as published."
    },
    "jurisdiction": {
      "$ref": "#/$defs/application__JurisdictionRef",
      "description": "The jurisdiction that decides the case."
    },
    "within": {
      "items": {
        "$ref": "#/$defs/application__Within"
      },
      "type": "array",
      "title": "Within",
      "description": "The jurisdictions that contain `jurisdiction`, largest first."
    },
    "agency": {
      "anyOf": [
        {
          "$ref": "#/$defs/Agency"
        },
        {
          "type": "null"
        }
      ],
      "description": "The office or board that handled the case. Null when not published."
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description",
      "description": "Description of the request, as published. Null when not published."
    },
    "parcels": {
      "items": {
        "$ref": "#/$defs/ParcelRef"
      },
      "type": "array",
      "title": "Parcels",
      "description": "Parcels the case concerns. Empty when none are matched, which is common when only an address is published."
    },
    "addresses": {
      "items": {
        "$ref": "#/$defs/Address"
      },
      "type": "array",
      "title": "Addresses",
      "description": "Addresses on the case. Empty when none are published."
    },
    "parties": {
      "items": {
        "$ref": "#/$defs/Party"
      },
      "type": "array",
      "title": "Parties",
      "description": "People and companies named on the case. Empty when none are published."
    },
    "dates": {
      "$ref": "#/$defs/CaseDates",
      "description": "Key dates. A null date means not published, not that the step did not happen."
    },
    "fees": {
      "items": {
        "$ref": "#/$defs/Fee"
      },
      "type": "array",
      "title": "Fees",
      "description": "Fees, by category. Empty when none are published."
    },
    "decision": {
      "anyOf": [
        {
          "$ref": "#/$defs/Decision"
        },
        {
          "type": "null"
        }
      ],
      "description": "The decision. Null while the case is pending."
    },
    "zoning": {
      "items": {
        "$ref": "#/$defs/ZoningRef"
      },
      "type": "array",
      "title": "Zoning",
      "description": "Zoning classifications the case concerns. Empty when there are none."
    },
    "document": {
      "anyOf": [
        {
          "$ref": "#/$defs/Document"
        },
        {
          "type": "null"
        }
      ],
      "description": "The published record. Null when not recorded."
    },
    "as_of": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ],
      "title": "As Of",
      "description": "Date of the most recent update to this case. Null when not recorded."
    },
    "href": {
      "type": "string",
      "title": "Href",
      "description": "The object's path in the API."
    }
  },
  "type": "object",
  "required": [
    "object",
    "id",
    "number",
    "type",
    "status",
    "jurisdiction",
    "within",
    "agency",
    "description",
    "parcels",
    "addresses",
    "parties",
    "dates",
    "fees",
    "decision",
    "zoning",
    "document",
    "as_of",
    "href"
  ],
  "$defs": {
    "Address": {
      "properties": {
        "raw": {
          "type": "string",
          "title": "Raw",
          "description": "Full address on one line: every line it is published on, in order, joined with a comma."
        },
        "recipient": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Recipient",
          "description": "Care-of or attention line, as published. Null when there is none."
        },
        "street_line_1": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Street Line 1",
          "description": "First street line: house number and street, or a PO box. Null when not published."
        },
        "street_line_2": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Street Line 2",
          "description": "Second street line: apartment, suite, unit or building. Null when there is none."
        },
        "street_number": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Street Number",
          "description": "House number. Null when not published."
        },
        "street_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Street Name",
          "description": "Street name, without its type. Null when not published."
        },
        "unit": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Unit",
          "description": "Unit number. Null when there is none."
        },
        "locality": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Locality",
          "description": "City, town or village. Null when not published."
        },
        "region": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Region",
          "description": "State, as its two-letter abbreviation. Null when not published."
        },
        "postal_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Postal Code",
          "description": "ZIP or postal code. Null when not published."
        },
        "point": {
          "anyOf": [
            {
              "$ref": "#/$defs/parcel__Point"
            },
            {
              "type": "null"
            }
          ],
          "description": "Location of the address point, as published. Null when not published."
        }
      },
      "type": "object",
      "required": [
        "raw"
      ],
      "title": "Address",
      "description": "A postal address, as published, with its parts where they are published separately."
    },
    "Agency": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Office name, as published."
        },
        "type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Type",
          "description": "Office type, such as `building`, `planning`, `zoning_board` or `commission`. Null when not published."
        }
      },
      "type": "object",
      "required": [
        "name"
      ],
      "title": "Agency",
      "description": "The office or board that handled a permit or case."
    },
    "CaseDates": {
      "properties": {
        "applied": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Applied",
          "description": "Filing date. Null when not published."
        },
        "decided": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Decided",
          "description": "Decision date. Null when not decided."
        },
        "expires": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expires",
          "description": "Expiration date of the approval. Null when not published."
        },
        "completed": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Completed",
          "description": "Date the case was closed. Null when not published."
        }
      },
      "type": "object",
      "title": "CaseDates",
      "description": "Key dates of a case, as published."
    },
    "Code": {
      "properties": {
        "code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Code",
          "description": "Code, as published."
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description",
          "description": "Meaning of the code, as published. Null when not published."
        },
        "standard": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Standard",
          "description": "Standard value, shared across jurisdictions. Null when not yet classified."
        }
      },
      "type": "object",
      "title": "Code",
      "description": "A coded value, as published, with its standard equivalent."
    },
    "Condition": {
      "properties": {
        "text": {
          "type": "string",
          "title": "Text",
          "description": "Condition text, as published."
        },
        "scope": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Scope",
          "description": "What the condition applies to, as published. Null when not stated."
        },
        "timing": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Timing",
          "description": "When the condition must be met, such as `before_permit`, `before_occupancy` or `ongoing`. Null when not stated."
        },
        "due": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Due",
          "description": "Due date. Null when not stated."
        }
      },
      "type": "object",
      "required": [
        "text"
      ],
      "title": "Condition",
      "description": "A condition of approval."
    },
    "Decision": {
      "properties": {
        "outcome": {
          "$ref": "#/$defs/Code",
          "description": "Outcome, as published. On a permit this is its status, so a permit issued and since expired reads `Expired`."
        },
        "decided_on": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Decided On",
          "description": "Decision date. Null when not published."
        },
        "effective_from": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Effective From",
          "description": "Effective date. Null when not published."
        },
        "effective_to": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Effective To",
          "description": "End date. Null while in effect."
        },
        "conditions": {
          "items": {
            "$ref": "#/$defs/Condition"
          },
          "type": "array",
          "title": "Conditions",
          "description": "Conditions of approval, as published. Empty when there are none. A listed condition is not necessarily met."
        }
      },
      "type": "object",
      "required": [
        "outcome",
        "conditions"
      ],
      "title": "Decision",
      "description": "The decision on a permit or case."
    },
    "Document": {
      "properties": {
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Url",
          "description": "URL of the published record. Null when not published."
        },
        "retrieved": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Retrieved",
          "description": "Date the record was retrieved. Null when not recorded."
        }
      },
      "type": "object",
      "title": "Document",
      "description": "The published record of a permit or case."
    },
    "Fee": {
      "properties": {
        "category": {
          "type": "string",
          "title": "Category",
          "description": "Fee category, such as `building`, `zoning`, `plan_review` or `impact`. `total` is all fees combined, present only when no fee is published by category."
        },
        "total": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Total",
          "description": "Amount charged. Null when not published."
        },
        "paid": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Paid",
          "description": "Amount paid. Null when not published."
        },
        "unpaid": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Unpaid",
          "description": "Amount outstanding. Null when not published."
        },
        "waived": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Waived",
          "description": "Amount waived. Null when not published."
        },
        "currency": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Currency",
          "description": "ISO 4217 currency code. Null when no amount is published."
        }
      },
      "type": "object",
      "required": [
        "category"
      ],
      "title": "Fee",
      "description": "Fees in one category."
    },
    "ParcelRef": {
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^prc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
          "title": "Id",
          "description": "A parcel id."
        },
        "number": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Number",
          "description": "Primary parcel number. Null when not published."
        },
        "href": {
          "type": "string",
          "title": "Href",
          "description": "The object's path in the API."
        }
      },
      "type": "object",
      "required": [
        "id",
        "href"
      ],
      "title": "ParcelRef",
      "description": "A parcel a permit or case concerns."
    },
    "Party": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Name, as published."
        },
        "role": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Role",
          "description": "Role, such as `applicant`, `owner`, `contractor`, `architect`, `engineer` or `representative`. Null when not published."
        },
        "organization": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Organization",
          "description": "Company or organization represented. Null when not published."
        },
        "license": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "License",
          "description": "License number. Null when not published."
        }
      },
      "type": "object",
      "required": [
        "name"
      ],
      "title": "Party",
      "description": "A person or company named on a permit or case."
    },
    "ZoningRef": {
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^zon_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "description": "A zoning id."
            },
            {
              "type": "null"
            }
          ],
          "title": "Id",
          "description": "A zoning id. Null when the code matches no zoning classification held for the jurisdiction."
        },
        "code": {
          "type": "string",
          "title": "Code",
          "description": "District code, as published."
        },
        "role": {
          "type": "string",
          "title": "Role",
          "description": "Role in the case. One of `from` (the current district in a rezoning), `to` (the requested district) or `subject` (the district, with no change requested)."
        },
        "href": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Href",
          "description": "The object's path in the API. Null when `id` is null."
        }
      },
      "type": "object",
      "required": [
        "code",
        "role"
      ],
      "title": "ZoningRef",
      "description": "A zoning classification a case concerns."
    },
    "application__JurisdictionRef": {
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^jur_[0-7][0-9a-hjkmnp-tv-z]{25}$",
          "title": "Id",
          "description": "A jurisdiction id."
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "The jurisdiction's common name."
        },
        "type": {
          "type": "string",
          "title": "Type",
          "description": "Kind of jurisdiction, in local terms, such as `county`, `parish`, `city` or `town`."
        },
        "fips": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Fips",
          "description": "The Census GEOID. Null outside the US."
        },
        "href": {
          "type": "string",
          "title": "Href",
          "description": "The object's path in the API."
        }
      },
      "type": "object",
      "required": [
        "id",
        "name",
        "type",
        "href"
      ],
      "title": "JurisdictionRef",
      "description": "The jurisdiction a permit or case was filed with."
    },
    "application__Within": {
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^jur_[0-7][0-9a-hjkmnp-tv-z]{25}$",
          "title": "Id",
          "description": "A jurisdiction id."
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "The jurisdiction's common name."
        },
        "tier": {
          "type": "string",
          "title": "Tier",
          "description": "Level of government. One of `national`, `region` (a state or province), `subregion` (a county or district) or `local` (a city, town, village or township)."
        },
        "type": {
          "type": "string",
          "title": "Type",
          "description": "Kind of jurisdiction, in local terms, such as `county`, `parish`, `city` or `town`."
        },
        "fips": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Fips",
          "description": "The Census GEOID. Null outside the US."
        }
      },
      "type": "object",
      "required": [
        "id",
        "name",
        "tier",
        "type"
      ],
      "title": "Within",
      "description": "A jurisdiction that contains another."
    },
    "parcel__Point": {
      "properties": {
        "lat": {
          "type": "number",
          "title": "Lat",
          "description": "Latitude, in WGS 84."
        },
        "lon": {
          "type": "number",
          "title": "Lon",
          "description": "Longitude, in WGS 84."
        }
      },
      "type": "object",
      "required": [
        "lat",
        "lon"
      ],
      "title": "Point",
      "description": "A point in WGS 84."
    }
  }
}