You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe there is a routing bug in @nestjs/swagger where it doesn't have a proper handler for */index.html, making it fall back to the default Swagger template (Petstore). related file
The current route handling logic to determine whether the document should be built and inserted into the HTML response is super strict on the / path and has to be more flexible when the request has the /index.html postfix.
Package version
7.3.0
NestJS version
10.3.2
Node.js version
v20.17.0
In which operating systems have you tested?
macOS
Windows
Linux
Other
This problem has persisted for over two years, has been reported twice as a GitHub issue, and has been discussed in several Discord posts.
Kamil closed #2475 & #1048 with the following quote:
Please clear your browser cache
I hope this well-detailed report convinces you this is not a client-side issue. You can see the differences between the Swagger initializer Javascript code and the HTML response. The minimal reproduction code was taken from the official NestJS samples, so no further changes were made on the developer side to make this happen.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Current behavior
I believe there is a routing bug in
@nestjs/swagger
where it doesn't have a proper handler for*/index.html
, making it fall back to the default Swagger template (Petstore
). related fileMinimum reproduction code
https://github.com/nestjs/nest/tree/master/sample/11-swagger
Steps to reproduce
npm i
npm run start:dev
http://127.0.0.1:3000/api/
- it works perfectlyhttp://127.0.0.1:3000/api/index.html
- does not build the document (fallbacks to thePetstore
example)http://127.0.0.1:3000/api/swagger-initializer.js
- this is the route where it returns thePetstore
exampleExpected behavior
The current route handling logic to determine whether the document should be built and inserted into the HTML response is super strict on the
/
path and has to be more flexible when the request has the/index.html
postfix.Package version
7.3.0
NestJS version
10.3.2
Node.js version
v20.17.0
In which operating systems have you tested?
Other
This problem has persisted for over two years, has been reported twice as a GitHub issue, and has been discussed in several Discord posts.
Kamil closed #2475 & #1048 with the following quote:
I hope this well-detailed report convinces you this is not a client-side issue. You can see the differences between the Swagger initializer Javascript code and the HTML response. The minimal reproduction code was taken from the official NestJS samples, so no further changes were made on the developer side to make this happen.
The text was updated successfully, but these errors were encountered: