-
Notifications
You must be signed in to change notification settings - Fork 38.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Versioning in Request Mappings #33599
Comments
IMO, versioning is against all APIs not particular API, you should create multiple contexts and mapping them to different API base url such as |
I don't think we should assume that users will only use this one way and that the others will be abandoned. |
I think it's a good proposition, Although it is currently possible to achieve this by extending RequestMappingHandlerMapping and customizing RequestCondition. |
Thanks for raising this. As far as I can see, this article lists several ways of dealing with API versions in a Spring Boot REST-like application:
It seems that this is not really promoting a version concept in the application itself: it cannot be injected as a method argument, versions are opaque strings and cannot be compared, etc. In the end, this looks like an additional mapping constraint for MVC endpoints. Most of these can be implemented already with custom annotations extending from Interestingly, the We could consider making this easier for developers. I do have some concerns though:
We're going to discuss this as a team. |
Expected effect
Route URLs to different methods based on some characteristics of the URI, request parameter, request header and so on. These should be configurable.
Known solutions
https://medium.com/@AlexanderObregon/a-guide-to-versioning-apis-in-spring-boot-329aae1c495f
I am not satisfied with this solution because it breaks the pattern
Convention Over Configuration
. I had to do a lot of hard coding.Reference
https://docs.micronaut.io/latest/guide/index.html#apiVersioning
Expected solution
version
for @RequestMapping and related annotations (@GetMapping
,PostMapping
, etc.). (recommended)@Version
, as in Micronaut.The text was updated successfully, but these errors were encountered: