Have I looked at API versioning guidelines? , but I'm not quite sure about the answer, so again I wonder about the version with a more specific example. I have two URIs (one with version as part of the URI and one without):
http://xxxx/v1/user/123 -> favored solution in discussed thread http://xxxx/user/123
I have doubts that the first link expresses the idea of ββREST. I find http://xxxx/v1/user/123 confusing, as it suggests that someday there will be a higher version of the api, like http://xxxx/v2/user/123 . But this does not make sense in terms of REST, the api version itself is HTTP 1.0 or 1.1, which is already sent inside the HTTP request. This resource-oriented REST resource is very different from other api interfaces such as SOAP or Java interfaces (where they usually have api versions in qualified names).
In REST, the only thing that makes sense in the version is the representation of this resource (for example, new fields are added or deleted). This versioning refers to the content negotiation part, for example:
http://xxx/user/123 + HTTP 'Accept' Header -> Content negotation through header http://xxx/user/123?v=1 -> for perma-links/hyperlinks
It can also be argued that such reconciling version content may be part of the URI inside the path, but I find it intuitive because you could get different URIs for the same resource and must support redirects to some point.
To summarize: there are no api versions in the REST URI, only a version of the resource representation. The presented version information refers to content negotiation (as a Param or HTTP "Accept" request).
What do you think? What things do you disagree / agree on?
rest versioning api-design
manuel aldana Jan 07 2018-10-17T00: 00Z
source share