Skip to content

Support restrictions fields in POST /places requests #65

@oliverbarnes

Description

@oliverbarnes

Out of the request fields defined on OSDM 3.4 for POST /places, we currently support placeInput.name.

This issue is for adding restrictions top level field to the request payload, complementing the placeInput fields.

Acceptance of the payload with restrictions depends on placeInput being present and valid (with either name or geoPosition present and valid).

The spec doesn't say whether restrictions depends on placeInput being present. And the way our implementation works now, returning a set even without search params (de facto working like GET /places, but with a cap of 20 results), having restrictions without placeInput would actually make sense.

restrictions has quite a few fields and subfields, so it might be good to break implementation down into separate issues and/or PRs.

{
  "placeInput": {
    "name": "Bern Bärengraben",
    "geoPosition": {
      "longitude": 8.54021,
      "latitude": 47.37818
    }
  },
  "restrictions": {
    "type": "STOP",
    "usage": "ORIGIN",
    "ptModes": {
      "exclude": true,
      "transportModes": [
        {
          "ptMode": "string",
          "name": "rail",
          "shortName": "S",
          "description": "string"
        }
      ]
    },
    "serviceBrandFilter": {
      "exclude": true,
      "serviceBrands": [
        "163, 175"
      ]
    },
    "carrierFilter": {
      "exclude": true,
      "carriers": [
        "string"
      ]
    },
    "pointOfInterestFilter": {
      "exclude": true,
      "pointOfInterestCategory": [
        {
          "osmTags": [
            {
              "tag": "name",
              "value": "Rozenrust"
            }
          ],
          "pointOfInterestClassifications": [
            "string"
          ]
        }
      ]
    },
    "numberOfResults": 1
  }
}

Please implement and update tests and README accordingly.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions