defaultVersion is not reflected in generated endpoint URLs (new versioning API)
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Current behavior
When defining the API versioning with defaultVersion the generated endpoint URLs are not accounting for the version prefix:
app.enableVersioning({ type: VersioningType.URI, defaultVersion: '1', });
Minimum reproduction code
https://github.com/shprota/swagger-example
Steps to reproduce
- yarn
- yarn start:dev
- open http://localhost:3007/api
- Default controller is explicitly annotated with a version and is callable
- Cats controller uses the defaultVersion and trying to execute it from the generated document leads to 404
Expected behavior
URLs of the endpoints be correct accounting for defaultVersion parameter.
Package version
5.1.3
NestJS version
8.1.1
Node.js version
14.16.0
In which operating systems have you tested?
- macOS
- Windows
- Linux
Other
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Defaulting to the Latest API Version on Swagger UI
This is now working, and I can set the API version at the top of the page to resolve to the various exposed...
Read more >How to use API versioning in .NET Core Web APIs using .NET 6
In this tutorial I will show you how to integrate API versioning in your .NET Core Web API (using .NET 6) to easily...
Read more >NET 5 - Use API versioning - Level Up Coding
We will use the default version (1.0) if a version is not specified in the request (if we don't define a version, all...
Read more >Dealing with default API versions in Swagger UI
Although default version route is not visible in Swagger it is still available, so endpoint can be accessed both from /v1/users and /users,...
Read more >.NET Core 3.1 Web API - Keeping Different API Versions In A ...
This article covers a practical scenario of maintaining a single code base with different versions of the same APIs.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you, @micalevisk !
Let’s track this here https://github.com/nestjs/swagger/pull/1632