{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/epa/json-schema/epa-cwa12-schema.json",
  "title": "cwa12",
  "description": "Map Output Object",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/epa-echo-clean-water-act-api-openapi.yml#/components/schemas/cwa12",
  "type": "object",
  "properties": {
    "QueryID": {
      "type": "string",
      "title": "Query Identifier",
      "description": "Sequential number assigned to entire search result"
    },
    "IconBaseURL": {
      "type": "string",
      "title": "Icon Base URL",
      "description": "URL where all the icons are located"
    },
    "PopUpBaseURL": {
      "type": "string",
      "title": "Popup Base URL",
      "description": "Combine this URL with the PUC to get popup info"
    },
    "MapData": {
      "type": "array",
      "title": "Map Data",
      "description": "An array of facility geospatial information.",
      "items": {
        "$ref": "#/$defs/cwa11"
      }
    }
  },
  "required": [
    "QueryID",
    "IconBaseURL",
    "PopUpBaseURL",
    "MapData"
  ],
  "$defs": {
    "cwa11": {
      "type": "object",
      "description": "Map Data Object",
      "properties": {
        "LAT": {
          "type": "string",
          "title": "Latitude",
          "description": "The latitude of the facility in degrees, to four decimal places"
        },
        "LON": {
          "type": "string",
          "title": "Longitude",
          "description": "The longitude of the facility in degrees, to four decimal places"
        },
        "ICON": {
          "type": "string",
          "title": "Icon",
          "description": "Name of each individual icon file within the URL base"
        },
        "TYPE": {
          "type": "string",
          "title": "Type",
          "description": "For DFR, this is always facility"
        },
        "NAME": {
          "type": "string",
          "title": "Name",
          "description": "For DFR, this is the Facility name. The name corresponds to the TYPE value"
        },
        "PUV": {
          "type": "string",
          "title": "Popup Value",
          "description": "Pop up value. Combine with PopUpBaseURL to give the popup for the facility"
        },
        "CWAstatus": {
          "type": "string",
          "description": "Quarterly compliance status for the most recent 13 quarters. Each letter indicates the compliance status for the corresponding quarter."
        },
        "LastInsp": {
          "type": "string",
          "title": "Last Inspection",
          "description": "The unique identifier for the last inspection"
        },
        "FormalCount": {
          "type": "string",
          "title": "Formal Count",
          "description": "The number of formal enforcement actions that have been taken against the facility"
        },
        "InformalCount": {
          "type": "string",
          "title": "Informal Count",
          "description": "The number of informal enforcement actions that have been taken against the facility"
        }
      },
      "required": [
        "LAT",
        "LON",
        "ICON",
        "TYPE",
        "NAME",
        "PUV",
        "CWAstatus",
        "LastInsp",
        "FormalCount",
        "InformalCount"
      ]
    }
  }
}