-
Notifications
You must be signed in to change notification settings - Fork 673
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add versioned HTTP API #2381
Comments
I have encountered the following methods of versioning the api.
In all the above we will require to maintain code for each version. The advantage and disadvantage being that we can maintain all the versions in parallel. My recommendation would be for URL versioning, it seems more intuitive and user friendly. It would be easy to update documentation. Would be easier for proxying and caching. |
OK, let's go with URL path versioning. It is simple, explicit, and easy for developers to understand and implement, and also the most popular for those reasons. For the time being, let's just address the URL prefix. We will not move implementation under |
Another point here is how the API version correlates to the code version? Do we keep separate modules/create wrapper packages, or determine API version from the version endpoint of the service? Should this be done on the deployment level (i.e. on ingress)? @felixgateru Please research this and write comments here. |
@felixgateru Please take this one. |
Code organizationWith implementing the URL versioning, the code can be organized in the following ways:
/api
/v1
/endpoints.go
/transport.go
/v2
/endpoints.go
/transport.go Depending on how different the versions are, this would necessitate expansion of the service interface as well to include versioned methods. This would enable mainting older versions of methods and introduce new methods. There is the possibility of code duplication between versioned methods.
The biggest drawback would be code duplication even in the service.
The biggest drawback would be major changes would require refactoring code used by all the versions.
Links: |
Is your feature request related to a problem? Please describe.
As we approach 1.0, we should start thinking of versioning our API.
Describe the feature you are requesting, as well as the possible use case(s) for it.
While we will make the best effort to keep post-v1.0 API compatible, there is no guarantee that will be possible. For those reasons, we should add versioning to enable using old API and seamlessly switch to newer versions of Magistrala.
Indicate the importance of this feature to you.
Must-have
Anything else?
No response
The text was updated successfully, but these errors were encountered: