3 ms·
For my rest apis I define a fixed endpoint /versions that returns an array of json objects that looks like: { “version”: “1.2.3”, “href”: “http
by rswail 3y ago
For my rest apis I define a fixed endpoint /versions that returns an array of json objects that looks like:
{
“version”: “1.2.3”,
“href”: “https://host/1.2.3”,
“not_before”: “2000-01–01T00:00Z”
“not_after”: “2025-01-01T00:00Z”
}
The array lists the available versions of the api and the endpoint to use. Not before/after can be null to indicate infinite past or future.
The contract for /versions is that the client must check it once every 24 hours for changes.
Allows deprecation of previous versions by changing a not after of null to a timestamp etc