Comments (11)
I'll schedule time with @avatarneil to discuss this morning (Tue 2 May)
from mobility-data-specification.
Hi @marie-x and @avatarneil do you have some thoughts on this you can share today?
from mobility-data-specification.
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.
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.
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.
application/json
I'd say
from mobility-data-specification.
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.
Fixed the 500 response type/schema across all OpenAPI endpoints in openmobilityfoundation/mds-openapi#37
from mobility-data-specification.
I think this issue can be closed after the one-line update in the spec around 500 response type.
from mobility-data-specification.
Nice! Thanks!
from mobility-data-specification.
Alright updated the language here: 0018992 (and then fixed "a" to "an").
from mobility-data-specification.
Related Issues (20)
- MDS 2.0 - Stops should have same response structure as vehicles or vice versa HOT 4
- MDS 2.0 - round-trip car sharing and reservation/reserved HOT 4
- Correction of description vehicle events (car sharing) HOT 3
- Car_type as an vehicle attribute HOT 1
- Minor additions to vehicle attributes // Car sharing HOT 4
- Add geographies to be returned in Reports in Requirements HOT 2
- Reports endpoint - START_DATE clarification HOT 4
- guidance on how to use telemetry data for compliance HOT 3
- What vehicles are included in the MDS 2.0 /vehicles endpoint? HOT 4
- Reports endpoint - description of START_DATE HOT 4
- Add mode in trips and vehicles objects HOT 6
- Data structure with sub-objects for mode-specific attributes complexifies the data ingestion HOT 1
- Adding a field in trip objects to cover cancelled trips easier HOT 2
- Add Provider ID: Nextbike HOT 2
- Error and bulk responses HOT 5
- Add the publication_time field in the telemetry object
- Supporting Advanced Air Mobility (AAM) HOT 1
- Add Provider ID: Starship Technologies HOT 3
- Add service_start_time and service_end_time to VEHICLES endpoint HOT 2
- Simplify /vehicles/status HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mobility-data-specification.