{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/appyway/json-schema/appyway-find-parking-entities-by-viewport-query-schema.json",
  "title": "FindParkingEntitiesByViewportQuery",
  "description": "Request for searching for Parking Entities for a given viewport. The viewport is supplied as a GeoJson polygon.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/appyway-parking-api-openapi.yml#/components/schemas/FindParkingEntitiesByViewportQuery",
  "required": [
    "viewport"
  ],
  "type": "object",
  "properties": {
    "viewport": {
      "type": "object",
      "properties": {
        "type": {
          "type": [
            "string",
            "null"
          ]
        },
        "crs": {
          "$ref": "#/$defs/Crs"
        },
        "coordinates": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "number",
                "format": "double"
              }
            }
          }
        }
      },
      "additionalProperties": false,
      "description": "Viewport for the query, expressed as a GeoJson polygon !:https://tools.ietf.org/html/rfc7946#section-3.1.6. Required. Limited to 1.5 km2."
    },
    "distanceCalculationLocation": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number",
          "description": "Latitude",
          "format": "double"
        },
        "lng": {
          "type": "number",
          "description": "Longitude",
          "format": "double"
        }
      },
      "additionalProperties": false,
      "description": "Custom location within the viewport from which to calculate distances for returned entities. Optional. If omitted, distances will be calculated\nfrom the centre of the viewport. This field is useful if you want to display or order entities by distance from a given point that is not the centre of your requested viewport."
    },
    "geometryPreference": {
      "$ref": "#/$defs/GeometryPreference"
    },
    "onStreetParkingTypes": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/OnStreetParkingType"
      },
      "description": "If supplied, only on-street parking entities that have the given On-Street Parking types will be included in the response. If null,\nall types will be returned.\n\n*StandardBay (1) - Standard bay (paid or free)\n*DisabledBay (2) - A bay requiring a disabled badge / permit during restricted hours\n*MotorcycleBay (3) - Designated motorcycle bay\n*ElectricBay (4) - A bay designated for electric vehicles only\n*CarClubBay (5) - A bay designated for Car Club members only during restricted hours\n*CoachBay (6) - A bay with space for a coach\n*LoadingBay (7) - A bay that allows Loading Only during restricted hours\n*TaxiBay (8) - Taxi bay\n*ResidentBay (9) - A bay designated for resident permit holders during restricted hours\n*SpecialBay (10) - A bay with special restrictions, e.g. RNLI, High Court or Ambulance bays\n*SingleYellowLine (11) - Single yellow line\n*DoubleYellowLine (12) - Double yellow line\n*SingleRedLine (13) - Single red line\n*DoubleRedLine (14) - Double red line\n*SingleYellowKerbMark (15) - Single yellow kerb marks\n*DoubleYellowKerbMark (16) - Double yellow kerb marks\n*KeepClearLine (17) - Keep Clear lines\n*DroppedKerbDriveway (18) - A dropped kerb driveway\n*RedRouteBay (19) - Red route bay\n*BusStop (20) - Bus stop\n*BusinessBay (21) - A business bay\n*DoctorBay (22) - A doctor's bay\n*HospitalBay (23) - An hospital bay\n*MarketTraderBay (24) - A market trader bay\n*HotelBay (25) - A Hotel bay\n*PoliceBay (26) - A police bay\n*RnliBay (27) - An RNLI bay\n*SupremeCourtBay (28) - Supreme court bay\n*AmbulanceBay (29) - An ambulance bay\n*CycleHireBay (30) - Cycle hire bay\n*CycleHangar (31) - Cycle hangar\n*AdvisorySchoolKeepClearLine (32) - Advisory school keep clear line\n*MobileLibraryBay (33) - A mobile library bay\n*DiplomatBay (34) - A diplomat bay\n*FireBrigade (35) - Fire brigade\n*CycleRack (36) - Cycle rack\n*SchoolKeepClearLine (37) - School keep clear line\n*None (-1) - Standard bay (paid or free)\n"
    },
    "filters": {
      "$ref": "#/$defs/FindParkingEntitiesByViewportFilters"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "BasemapTranslation": {
      "enum": [
        1,
        2
      ],
      "type": "integer",
      "description": "Enumeration for the different types of base maps\n\n*OrdnanceSurvey (1) - Ordnance Survey: Realistic mapping\n*OpenStreetMaps (2) - Open street map.\n",
      "format": "int32"
    },
    "Crs": {
      "type": "object",
      "properties": {
        "type": {
          "type": [
            "string",
            "null"
          ]
        },
        "properties": {
          "$ref": "#/$defs/CrsProperties"
        }
      },
      "additionalProperties": false
    },
    "CrsProperties": {
      "type": "object",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "FindParkingEntitiesByViewportFilters": {
      "type": "object",
      "properties": {
        "excludeEntityTypes": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/MapEntityType"
          },
          "description": "If supplied, entities that have the given Map Entity types will be excluded from the response. Passing Zone or Authority\nentity types will result in a Bad Request response.\n\n*OnStreet (1) - An on-street parking area\n*Carpark (2) - An off-street parking facility (car park) including surface and multi-storey car parks.\n*Zone (3) - A zone is an area defined by the local authority that acts as a container for a set of On-Street and Car park entities.\nA zone may define common parking rules that are applicable generally across parts of the kerb (e.g. Single Yellow Lines) and may\ndefine rules parking entities that can be overridden by individual entities.\n*Authority (4) - Defines the area controlled by a particular local authority. Authorities may contain zones and may also contain parking entities directly.\n"
        }
      },
      "additionalProperties": false,
      "description": "Filters that a caller can apply to limit the results returned when searching for parking entities by viewport"
    },
    "GeometryPreference": {
      "type": "object",
      "properties": {
        "basemap": {
          "$ref": "#/$defs/BasemapTranslation"
        },
        "geometryTypes": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/GeometryType"
          },
          "description": "List of the types of geometries you want to receive for this basemap\n\n*POI (1) - Point of interest: A single point, will be of type \"Point\"\n*Kerb (2) - Single line along the kerbedge, will be of type \"LineString\"\n*Outline (3) - A complete representation of the parking area, will be of type \"Polygon\". Only available for Ordnance Survey base maps\n"
        }
      },
      "additionalProperties": false,
      "description": "Indicates the type of geometries you want to retrieve"
    },
    "GeometryType": {
      "enum": [
        1,
        2,
        3
      ],
      "type": "integer",
      "description": "Different types of geometries that can be returned\n\n*POI (1) - Point of interest: A single point, will be of type \"Point\"\n*Kerb (2) - Single line along the kerbedge, will be of type \"LineString\"\n*Outline (3) - A complete representation of the parking area, will be of type \"Polygon\". Only available for Ordnance Survey base maps\n",
      "format": "int32"
    },
    "MapEntityType": {
      "enum": [
        1,
        2,
        3,
        4
      ],
      "type": "integer",
      "description": "Enumeration for the different types of Map Entity - objects returned by the API that can be drawn on a map.\n\n*OnStreet (1) - An on-street parking area\n*Carpark (2) - An off-street parking facility (car park) including surface and multi-storey car parks.\n*Zone (3) - A zone is an area defined by the local authority that acts as a container for a set of On-Street and Car park entities.\nA zone may define common parking rules that are applicable generally across parts of the kerb (e.g. Single Yellow Lines) and may\ndefine rules parking entities that can be overridden by individual entities.\n*Authority (4) - Defines the area controlled by a particular local authority. Authorities may contain zones and may also contain parking entities directly.\n",
      "format": "int32"
    },
    "OnStreetParkingType": {
      "enum": [
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        14,
        15,
        16,
        17,
        18,
        19,
        20,
        21,
        22,
        23,
        24,
        25,
        26,
        27,
        28,
        29,
        30,
        31,
        32,
        33,
        34,
        35,
        36,
        37,
        -1
      ],
      "type": "integer",
      "description": "Indicates the type of on an OnStreet bay.\n\n*StandardBay (1) - Standard bay (paid or free)\n*DisabledBay (2) - A bay requiring a disabled badge / permit during restricted hours\n*MotorcycleBay (3) - Designated motorcycle bay\n*ElectricBay (4) - A bay designated for electric vehicles only\n*CarClubBay (5) - A bay designated for Car Club members only during restricted hours\n*CoachBay (6) - A bay with space for a coach\n*LoadingBay (7) - A bay that allows Loading Only during restricted hours\n*TaxiBay (8) - Taxi bay\n*ResidentBay (9) - A bay designated for resident permit holders during restricted hours\n*SpecialBay (10) - A bay with special restrictions, e.g. RNLI, High Court or Ambulance bays\n*SingleYellowLine (11) - Single yellow line\n*DoubleYellowLine (12) - Double yellow line\n*SingleRedLine (13) - Single red line\n*DoubleRedLine (14) - Double red line\n*SingleYellowKerbMark (15) - Single yellow kerb marks\n*DoubleYellowKerbMark (16) - Double yellow kerb marks\n*KeepClearLine (17) - Keep Clear lines\n*DroppedKerbDriveway (18) - A dropped kerb driveway\n*RedRouteBay (19) - Red route bay\n*BusStop (20) - Bus stop\n*BusinessBay (21) - A business bay\n*DoctorBay (22) - A doctor's bay\n*HospitalBay (23) - An hospital bay\n*MarketTraderBay (24) - A market trader bay\n*HotelBay (25) - A Hotel bay\n*PoliceBay (26) - A police bay\n*RnliBay (27) - An RNLI bay\n*SupremeCourtBay (28) - Supreme court bay\n*AmbulanceBay (29) - An ambulance bay\n*CycleHireBay (30) - Cycle hire bay\n*CycleHangar (31) - Cycle hangar\n*AdvisorySchoolKeepClearLine (32) - Advisory school keep clear line\n*MobileLibraryBay (33) - A mobile library bay\n*DiplomatBay (34) - A diplomat bay\n*FireBrigade (35) - Fire brigade\n*CycleRack (36) - Cycle rack\n*SchoolKeepClearLine (37) - School keep clear line\n*None (-1) - Standard bay (paid or free)\n",
      "format": "int32"
    }
  }
}