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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance forRoutes RouteInfo object to specify API versions #8844
Comments
I believe this feat will help on making HTTP versioning a first-class citizen on NestJS. That's cool. @NitnekB As we can use multiple versions on
|
@micalevisk Seems legit to me 馃憤 |
May I ask for any update on this issue? |
@chanpaul1234572 I didn't have time to try to implement this :/ PRs are more than welcomed |
@kamilmysliwiec I would like to implement this. |
@princechauhan1992 PRs are more than welcomed 馃樃 |
Guys, I will get this one! 馃榿 |
I'm taking this one, @kamilmysliwiec. I've been already able to reproduce the issue in an integration test. |
Sounds great @thiagomini! |
I couldn't find the original PR that introduced version-aware middleware but the implementation is currently buggy when global prefix is configured. It produced:
instead of:
I.e. the version number is prepended before the global prefix, not the other way around. I'll create an issue. |
Hey @mareksuscak, this is the PR that introduced that. Feel free to add the necessary fix to it! I can work on that as well as soon as I have the time. Thanks for lettings us know 馃槉 |
My approach to resolving this issue would be to reproduce the same problem in this test. As soon as you get the same error, work on your way down the layers to make it pass with the least amount of changes. Then, you can refactor it to a cleaner solution. |
Here's the ticket: #10566 |
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
I currently use NestJS versioning feature, which is nice BTW 馃殌
I also use a custom middleware the most common way:
But this caused a regression and my middleware doesn't works anymore.
The only way to make it works is to specify each route, or exclude the one we doesn't want:
This works well, but we have to fill in the version for each route:
/v0/products
, ...Describe the solution you'd like
I dont' know if we should consider this as a bug, but I think we could use another parameter
versions
when declaring routes onforRoutes
method enhancingRouteInfo
type.Teachability, documentation, adoption, migration strategy
Here an example of what I'm thinking about:
What is the motivation / use case for changing the behavior?
Prevent lots of works introducing or deprecating API versions
The text was updated successfully, but these errors were encountered: