Open carrythebanner opened 8 months ago
with #672 and https://github.com/shift-org/shift-docs/commit/130f1f0190033ed872d97533acc2567afa33d383 sends a version number from the server with every response. configured in config.js
api: {
header: 'Api-Version',
version: "3.50.0",
},
The API should include the version number as a header in responses, e.g.
(Major version number only?)
Clients would also be encouraged (though not required) to include the version they're using in requests. If the client doesn't specify, the server would assume the latest version. In the future we may rev the version and introduce breaking changes, so clients should send the version they're expecting to ensure a predictable response.
As a proof of concept for handling different versions, we could check for v1 or v2 requests and reject those. (There should be no real requests for those versions, because those version numbers were defined post-hoc well after we were already on v3.) Error status code could be 400, or possibly 406 (Not Acceptable).