Giter Site home page Giter Site logo

Comments (11)

marie-x avatar marie-x commented on June 26, 2024 2

I'll schedule time with @avatarneil to discuss this morning (Tue 2 May)

from mobility-data-specification.

schnuerle avatar schnuerle commented on June 26, 2024

Hi @marie-x and @avatarneil do you have some thoughts on this you can share today?

from mobility-data-specification.

thekaveman avatar thekaveman commented on June 26, 2024

Here's what I came up with for errors needing Bulk Responses, I'm implementing in the OpenAPI as a starting point but we can always adjust if needed:

Sorted by endpoint

Endpoint HTTP method Error key Error description HTTP code
/event POST bad_param A validation error occurred 400
/event POST missing_param A required parameter is missing 400
/event POST unregistered This device_id is unregistered 404
/reports POST bad_param A validation error occurred 400
/stops POST already_registered A stop with stop_id is already registered 409
/stops POST bad_param A validation error occurred 400
/stops POST missing_param A required parameter is missing 400
/stops PUT bad_param A validation error occurred 400
/stops PUT missing_param A required parameter is missing 400
/stops PUT unregistered This stop_id is unregistered 404
/telemetry POST bad_param A validation error occurred 400
/telemetry POST missing_param A required parameter is missing 400
/telemetry POST unregistered This device_id is unregistered 404
/trips POST bad_param A validation error occurred 400
/trips POST missing_param A required parameter is missing 400
/trips POST unregistered This device_id is unregistered 404
/vehicles POST already_registered A vehicle with device_id is already registered 409
/vehicles POST bad_param A validation error occurred 400
/vehicles POST missing_param A required parameter is missing 400
/vehicles PUT bad_param A validation error occurred 400
/vehicles PUT unregistered This device_id is unregistered 404

Sorted by Error key

Endpoint HTTP method Error key Error description HTTP code
/stops POST already_registered A stop with stop_id is already registered 409
/vehicles POST already_registered A vehicle with device_id is already registered 409
/event POST bad_param A validation error occurred 400
/reports POST bad_param A validation error occurred 400
/stops POST bad_param A validation error occurred 400
/stops PUT bad_param A validation error occurred 400
/telemetry POST bad_param A validation error occurred 400
/trips POST bad_param A validation error occurred 400
/vehicles POST bad_param A validation error occurred 400
/vehicles PUT bad_param A validation error occurred 400
/event POST missing_param A required parameter is missing 400
/stops POST missing_param A required parameter is missing 400
/stops PUT missing_param A required parameter is missing 400
/telemetry POST missing_param A required parameter is missing 400
/trips POST missing_param A required parameter is missing 400
/vehicles POST missing_param A required parameter is missing 400
/event POST unregistered This device_id is unregistered 404
/stops PUT unregistered This stop_id is unregistered 404
/telemetry POST unregistered This device_id is unregistered 404
/trips POST unregistered This device_id is unregistered 404
/vehicles PUT unregistered This device_id is unregistered 404

from mobility-data-specification.

thekaveman avatar thekaveman commented on June 26, 2024

I think the final question on this is for 500 -- should that really be a text/plain response, or should that be application/json with the body of the single-error response?

{
  "error": "...",
  "error_description": "...",
  "error_details": ["...", "..."]
}

from mobility-data-specification.

schnuerle avatar schnuerle commented on June 26, 2024

I've made a pass across all APIs to align each endpoint to the responses listed in this comment and in the current OpenAPI and Stoplight docs.

Take a look at the release branch to confirm. Example of how I documented it - see the 'Responses' header.

I did not address the 500 question yet. I could go either way on this so welcome feedback @thekaveman @marie-x @avatarneil If it's a quick easy change to OpenAPI (and we think it's a good idea) let's do it today. For MDS spec it's easy now and just changing one line here.

from mobility-data-specification.

marie-x avatar marie-x commented on June 26, 2024

application/json I'd say

from mobility-data-specification.

thekaveman avatar thekaveman commented on June 26, 2024

It sounds like would want to update the 500 response across all OpenAPI docs then. I'll work on this this morning and get back to this thread.

from mobility-data-specification.

thekaveman avatar thekaveman commented on June 26, 2024

Fixed the 500 response type/schema across all OpenAPI endpoints in openmobilityfoundation/mds-openapi#37

from mobility-data-specification.

thekaveman avatar thekaveman commented on June 26, 2024

I think this issue can be closed after the one-line update in the spec around 500 response type.

from mobility-data-specification.

marie-x avatar marie-x commented on June 26, 2024

Nice! Thanks!

from mobility-data-specification.

schnuerle avatar schnuerle commented on June 26, 2024

Alright updated the language here: 0018992 (and then fixed "a" to "an").

from mobility-data-specification.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.