Open TNieminen opened 4 years ago
Yeah I can include that in the README for sure, but what do you think of the strategy? Should the versions be nested in folders this way or should provider/controller files be named provide-something.v1.js
instead?
The question of versioning might be bigger as well, like do we want to provide long term support to multiple API versions? This server will actually default a versionless URI to whatever version specified, so we might want to consider as we solidify our resource standards to at least internally defaulting to versionless, while only using versions for when we want to prevent a breaking change on our own front end. That way we can also deprecate versions as we need.
Yeah I can include that in the README for sure, but what do you think of the strategy? Should the versions be nested in folders this way or should provider/controller files be named
provide-something.v1.js
instead?
I personally like file structure over dot notation because it keeps folders more easily readable, but that is just a personal preference.
vs
This server will actually default a versionless URI to whatever version specified, so we might want to consider as we solidify our resource standards to at least internally defaulting to versionless
Do you mean that the LTS API version would be running at versionless? so v1, v2, v3 are some new features, but if the latest feature is v4, it would also be available without a version basically working rather similarly to the atlassians /latest/?
As for deprecating APIs, I think it would be good to have a clear deadline for the front-end for deprecation so they know by what time they should by latest react. We could for instance seek to support (like atlassian) two versions at a given time, and if we for instance have now added a v3, we would set a deprecation message to all v1 APIs (hopefully with a setup where we can change this in only one place) that by one month from now this API will be deprecated. We could have for instance a standard format in the response body:
{ deprecatesBy:new Date() }
and then on the frontend we could go
if(res.body.deprecatesBy){
console.warn(API ${req.url} is set to be deprecated by ${res.body.deprecatesBy}
)
}
Yeah sure, we can include that in the JSend spec to deprecate APIs. The important thing here is to make sure we agree that API versions shouldn't be supported long-term since we don't have the manpower to maintain them. I think versioning makes more sense when you serve thousands of different clients who rely on stable APIs on their business end. Without that, it should be slightly discouraged.
Since the template is encouraging API versioning, a guideline for API versioning should be outlined. One good example of this can be found in Atlassian docs:
Version Control for APIs
https://developer.atlassian.com/server/framework/atlassian-sdk/atlassian-rest-api-design-guidelines-version-1/#version-control-for-apis