-
Notifications
You must be signed in to change notification settings - Fork 232
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
Consider using JSON Schema #46
Comments
I think this is a great idea. I will start putting together a PR for |
Agreed. We call out using JSON API (which includes JSON Schema) in the provider spec currently but the implementation is not there yet. For Agency I believe we should enforce as well. @toddapetersen |
I started putting something together over here: https://github.com/CityofSantaMonica/mobility-data-specification/blob/json-schema/provider/schema.json Take a look at let me know if this seems like the right direction. I generated this using some sample data I cooked up and the tool at https://www.jsonschema.net/ |
@thekaveman that's awesome. Can you open a PR to allow for commenting? |
This would be a breaking change, tagging as a 0.2.0 milestone. |
#53 is merged. closing. |
The mobility spec already provides some nice narrative description of the inputs and outputs for the REST API. However, there is still some room for ambiguity, and it would be useful to be able to test providers/agencies against regressions and compliance with the spec.
One commonly-used approach to this problem is to use a JSON schema. This allows you to describe JSON data structures in a well-typed fashion. This allows for
For instance, a schema for the response body of the
/deregister-vehicle
might look something like:High-quality JSON-schema validators should exist in most web-friendly languages.
The text was updated successfully, but these errors were encountered: