-
Notifications
You must be signed in to change notification settings - Fork 4
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
versioning: in URL or in HTTP header? #1
Comments
In GitLab by @pvdbosch on Mar 19, 2018, 18:08 Versioning strategiesGlobal URI versioningMajor version in the path (e.g., /api/v1/companies) or in subdomain (e.g., api-v2.foo.com/companies)
Media type versioning (header-based)Return different resource version depending on ‘Accept’ header of request, e.g. Accept: application/resource.v1+json
API EvolutionAvoid versioning as long as possible. Add new fields to existing resource representations next to old properties. Mark old fields as deprecated, but keep supporting them during a transition period during which clients can switch to the new version.
Other guidelines
Warning: 299 - "Miscellaneous Persistent Warning" "The parameter x has been deprecated and will be removed by {date}."
ConclusionsMedia type versioning still leaves some unsolved issues and quite some cases may be solved with API Evolution. Proposal:
Reference material: |
In GitLab by @pvdbosch on Mar 21, 2018, 09:54 Feedback Willem sent me by mail: Bij SocSec gebeurt api versioning in de URI en maakt deel uit van het basePath vb. API gateway 7.5.3 ondersteunt enkel deze mode (in 7.6 komt daar query-param based versioning bij, maar geen http header versioning) Volgens de RESTafarians is geen versioning de beste aanpak, maar misschien niet realistisch. Via redirects en content negotitiation zou een API nooit geversioneerd hoeven te worden. We hebben ook gedacht aan een verschil te maken tussen versioning van resources (URI) tov van versioning van representations (maar nog nooit in praktijk gebracht) bv
dus URI blijven langer stabiel, maar representations kunnen wel binnen een bepaalde van versie van een API evolueren. Dit mapt ook mooi op het @producers concept van JAX-RS |
In GitLab by @pvdbosch on Apr 18, 2018, 18:01 Conclusions of last meeting were:
I added this to the styleguide. Included deprecation guidelines under API evolution |
In GitLab by @pvdbosch on Apr 18, 2018, 18:01 closed |
In GitLab by @wsalembi on Feb 23, 2018, 08:52
Beslissen of versienummer wordt opgenomen in URL van de API (momenteel in styleguide) versus in HTTP-header.
eHealth:
KSZ: voorkeur in URL
FOD Fin:
VAS:
We prefer to put the version in the URL because it is easier to manage (our RP will forward all requests to Openshift and Openshift I don't know if it can handle HEADERS for the dispatching).
While the API structure (list of resources) are the same, we prefer to keep the same major version in the URL.
If there is a major change in the API structure (reorganisation of the resources), we prefer to create a new major version. Both versions are deployed at the same time to allow the clients to migrate progressively to the new version.
This kind of change should be very rare.
Example: application/json;version=1
The text was updated successfully, but these errors were encountered: