Description
Description
Introduce version handling of the API
Also, see #288 in the frontend
Motivation
By version handling, the API users can upgrade EI without having to change their code. The user can switch to the new API when they have the possibility.
Exemplification
Here you can read briefly about API versioning:
https://restfulapi.net/versioning/
The most common way is to append /v1 at the root path.
Suggested way forward:
We will keep supporting the old API (available in EI 2.x instances) and the new API (available from EI 3.x instances). But we will denote the old API as deprecated already in this implementation - to encourage users to migrate/new users to use the latest API.
We will not support a use case where the user accesses the API without any specified version (no default should exist). Users will be forced to always explicitly specify which version of the API they want to access.
Example:
Allowed:
www.eiffel-intelligence/v1/subscriptions
www.eiffel-intelligence/v2/subscriptions
Not allowed:
www.eiffel-intelligence/subscriptions
This implementation will be included in a future 4.0.0 release (because it will not be backwards compatible).
Deprecation strategies:
If and when we release a new major release of the API (a v3 API) we will remove support for the oldest API (v1) to only keep support for 2 API versions at the same time.
Latest API version ---> v2/
Deprecated API version ---> v1/
When EI with API version v3/ is released:
Latest API version ---> v3/
Deprecated API version ---> v2/
Deprecated API version v1/ ---> removed
Benefits
By version handling the API, it will be backward compatible.
For future users it will become easier to migrate between API versions, and they can decide when they feel ready to switch to a higher version of the API.
Possible Drawbacks
The planned implementation will mean a breaking change, with current users being forced to explicitly specify a version in the url to Eiffel Intelligence, whenever they want to access the API.
This will have to be included in a 4.0.0 release.