-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add proposal for api versioning #4
Conversation
i propose to use the `Accept` header in order to clean URLs of the resources, and because my main approach on the design of the API is to use the header to communicate data, because that is why HTTP headers were built for and we will use them for several applications, as localization, caching, authentication, etc.
request headers | ||
|
||
``` | ||
Accept: application/vnd.super-app+json; version=1.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note the definition of a vendor content type, depending on the app vnd.super-app+json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about these kind of versioning?
GET hyper.super-app.no/api/v1/spaceships
It is also cleaner, but there is a benefit in seeing clearly, what version you are using.
When updating the apps to newer API, only baseURL change would be required to start development with new version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like that approach as well
the reason I am proposing the header version, it's that we will be using headers for many purposes already
and other intelligent people are using headers as well
there is a discussion in that repo as well, but i want to read a little further to understand the choices
but mainly, the purpose of this PR is to evaluate options
I like headers, too, but mostly just because that's what headers are for. I guess it makes it harder to share the endpoints because you won't be able to do it with just an URL, but I'm okay with that (you'll probably need to authenticate anyway, and you definitely don't want that part in the URL). So that's 👍 from me. |
We have some missing capitalizations and punctuations in this pull request though, so I'm fixing those; I think beautifully written English in our playbooks is as important as beautifully written code in our applications. :-) |
What do you think about this, @hyperoslo/ruby? |
I kinda like using a custom-header for versioning And there is this when using Accept header in Rails (from versionist gem):
|
close because of inactivity |
i propose to use the
Accept
header in order to clean URLs of theresources, and because my main approach on the design of the API is to
use the header to communicate data, because that is why HTTP headers
were built for
and we will use them for several applications, as localization,
caching, authentication, etc.