Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provider and Policy GET data payloads vs. other data payloads #841

Closed
thekaveman opened this issue Apr 23, 2023 · 7 comments
Closed

Provider and Policy GET data payloads vs. other data payloads #841

thekaveman opened this issue Apr 23, 2023 · 7 comments
Labels
Policy Specific to the Policy API Provider Specific to the Provider API question Further information is requested Schema Implications for JSON Schema or OpenAPI
Milestone

Comments

@thekaveman
Copy link
Collaborator

Issue

Provider defines the data payload under the data top-level key, with an endpoint-specific key that holds the array of items:

{
    "version": "2.0.0",
    "data": {
        "vehicles": [
             // vehicle objects here
         ]
     }
}

This differs from e.g. Agency and Geographies, which define their GET payloads as top-level keys on their own, without the addition of the data layer:

{
    "version": "2.0.0",
    "vehicles": [
        // vehicle objects here
     ]
}

Suggestion

Align Provider with the other APIs, by removing the additional data layer in the response payload, and returning the actual data items as a top-level key, like in Agency and Geographies.

@thekaveman thekaveman added the question Further information is requested label Apr 23, 2023
@schnuerle
Copy link
Member

Is Provider the only one like this? What about Metrics, Policy, Jurisdiction? If provider is the only one using data I'd say we should change it too.

cc @marie-x

@schnuerle schnuerle transferred this issue from openmobilityfoundation/mds-openapi Apr 24, 2023
@schnuerle schnuerle added this to the 2.0.0 milestone Apr 24, 2023
@marie-x
Copy link
Collaborator

marie-x commented Apr 24, 2023

Agree with @thekaveman

@schnuerle schnuerle added Provider Specific to the Provider API State Machine Changes in the vehicle state events and state machine diagram labels Apr 24, 2023
@thekaveman thekaveman added Schema Implications for JSON Schema or OpenAPI and removed State Machine Changes in the vehicle state events and state machine diagram labels Apr 24, 2023
@thekaveman
Copy link
Collaborator Author

Policy

Defines it like Provider does, with a top-level data key:

{
  "version": "x.y.z",
  "updated": 1570035222868,
  "data": {
     "policies": [ ... ]
  }
}

Suggest to change this to the same style as we are talking about here for Provider.

Jurisdiction

Defines it like Agency and Geographies, at the top-level (based on what is shown in the examples):

{
    "version": "1.2.0",
    "updated": "1570035222868",
    "end_date": "1570035222868",
    "jurisdictions": [ ... ]
}

This is the style we should align Provider and Policy to.

Metrics

Everything is at the top-level and the response format is pretty different from other MDS APIs.

No need to change anything here.

@thekaveman
Copy link
Collaborator Author

thekaveman commented Apr 24, 2023

This is being handled for Provider in OpenAPI in openmobilityfoundation/mds-openapi#5

@schnuerle
Copy link
Member

I will work to make this change in the MDS spec.

@thekaveman thekaveman added the Policy Specific to the Policy API label Apr 28, 2023
@thekaveman thekaveman changed the title Provider GET data payloads vs. other data payloads Provider and Policy GET data payloads vs. other data payloads Apr 28, 2023
@schnuerle
Copy link
Member

Fixed this by removing the data level across Provider and Policy in this commit. Can close this issue upon @thekaveman review.

@thekaveman
Copy link
Collaborator Author

Yep looks good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Policy Specific to the Policy API Provider Specific to the Provider API question Further information is requested Schema Implications for JSON Schema or OpenAPI
Projects
None yet
Development

No branches or pull requests

3 participants