-
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
API Versioning #114
Comments
Currently, it is AT LEAST required in the response body, as part of JSON API compliance. see {
"version": "x.y.z",
"data": {
"trips": [{
"provider_id": "...",
"trip_id": "...",
}]
}
} I know some companies have done it in URL vs Header, for now I think we can support either (header OR URL) but would be good to standardize. I think inside the JSON payload is best but open to other options. |
This is actually spelled out in the JSON Schema - it must come as part of the response, like we show in the README. I kind of this this isn't an open issue, it's been solved. |
Is the question actually "should there be a way to request a specific MDS version from provider endpoints"? API route version identifiers and headers are both ways to do that. |
Perhaps I was getting ahead of myself. How would one "request" a different version? |
@dyakovlev my point exactly 👍 |
Got it, thanks for the clarification @dyakovlev |
to save folks the googling, I spent a little time reading about this earlier today. The consensus seems to be "there is no clearly better way, use whatever you've managed to agree to. Avoid getting into arguments about REST semantics with purists". FWIW, I prefer URI versions, but providers may have different preferences based on their data systems. Reviewing the list of providers, looks like there are already three schemes in flight, so maybe a standard would be beneficial. |
While I normally like to version on the URL, it may make sense to do this as a header. In my case, exposing a new URL to the world is additional overhead, while forking code paths based on a header is less involved. Given that the spec is evolving quickly and is likely to continue to do so, I can easily see a case when certain agencies and providers are on different versions. If the version is specified an an arbitrary place in the URL then agencies will need to keep track of that, rather than standardizing on a header and a potential error format if the provider does not support the version requested by the header. I can put together a PR for this in the next day. |
@noonhub checking in on this PR |
ref #152. If we have agency and provider implementation with different versions, it will make sense to have the header implementation of this be done so that if a provider or agency implementation is support 2 or more versions, the requester can ask for the specific version. |
I have actually revised my thinking here. I believe that major versions should be handled in the URL and that a provider should only support a single minor & patch version under each major version at any given time. Given the semantics of semvar, changing the minor and patch versions under a major versions should not introduce breaking changes and should be fine to move around as the provider wants to. Thoughts? |
I am going to weigh in here. @noonhub, I think the support for a specific version will be more complex than just a version number in the future of Agency. For example, on the technology roadmap, we have considered a "GetParking" endpoint for vehicles... a digital parking product of sorts. @hunterowens @thekaveman Would like to get your input here. |
It sounds like you are describing an optional endpoint which from the spec's perspective is the same as an optional field or parameter. The spec indicates that it is optional and possibly describes how an implementation should handle if they do not implement that field, parameter, or endpoint. In the case of fields they can be omitted or set to |
@toddapetersen I see where you are coming from, and definitely For example, imagine the A change in data format like above is independent of whether or not a given The "what features does this |
`provider` APIs must support versioning going forward. As implemented here, we will use a custom media-type to negotiate the API version a client and server will use. A couple reasons for taking this approach: * API versioning will become important as 0.3.0 and future releases are published with breaking changes that Providers, cities and third-parties will need to implement/adopt on differing timelines. * Because this is a specification for others (Providers) to implement their APIs against, mandating URI structure beyond endpoints could be burdensome or limiting. Conversely, leveraging standard HTTP Headers in a compliant manner places no limitations. * Further, in practice, many providers have already begun implementing their own versioning in their registered `mds_api_url`. Closes openmobilityfoundation#114
Putting up #216 as a proposal for adding this to the specification. In the commit message/PR description I outlined my rationale for proposing staying with versioning via Headers. Looking forward to getting this in. |
`provider` APIs must support versioning going forward. As implemented here, we will use a custom media-type to negotiate the API version a client and server will use. A couple reasons for taking this approach: * API versioning will become important as 0.3.0 and future releases are published with breaking changes that Providers, cities and third-parties will need to implement/adopt on differing timelines. * Because this is a specification for others (Providers) to implement their APIs against, mandating URI structure beyond endpoints could be burdensome or limiting. Conversely, leveraging standard HTTP Headers in a compliant manner places no limitations. * Further, in practice, many providers have already begun implementing their own versioning in their registered `mds_api_url`. Closes #114
Do we want to specify in this spec whether the provider API version should be in a standard location (eg. header vs URL) or leave it up to each provider to determine?
The text was updated successfully, but these errors were encountered: