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
Let's assume we have a route param that we obtain in the route handler using @Param() decorator on the handler's argument. If that argument has non-primitive type (i.e. we use entity resolving pipe) then that param does not appear in the Swagger UI. But it works well if argument type has primitive type, even object.
That code will render id route param properly in Swagger UI:
Also works if i use object as argument type and does not when using any class
Minimum reproduction code
See examples and screenshots above
Steps to reproduce
No response
Expected behavior
It is expected for route params to appear in Swagger UI no matter what types they have in route handlers. A possible solution may be to prefer type from @ApiParam() decorator's options, if provided, over the argument type.
Package version
7.3.0
NestJS version
10.3.3
Node.js version
20.11
In which operating systems have you tested?
macOS
Windows
Linux
Other
The project is running inside Docker on WSL Ubuntu using node:20.11-bullseye as base image
Is there an existing issue for this?
Current behavior
Let's assume we have a route param that we obtain in the route handler using
@Param()
decorator on the handler's argument. If that argument has non-primitive type (i.e. we use entity resolving pipe) then that param does not appear in the Swagger UI. But it works well if argument type has primitive type, evenobject
.That code will render
id
route param properly in Swagger UI:At the same time, the following example will not show any route params:
Also works if i use
object
as argument type and does not when using any classMinimum reproduction code
See examples and screenshots above
Steps to reproduce
No response
Expected behavior
It is expected for route params to appear in Swagger UI no matter what types they have in route handlers. A possible solution may be to prefer type from
@ApiParam()
decorator's options, if provided, over the argument type.Package version
7.3.0
NestJS version
10.3.3
Node.js version
20.11
In which operating systems have you tested?
Other
The project is running inside Docker on WSL Ubuntu using
node:20.11-bullseye
as base imageOther NestJS dependencies used:
The text was updated successfully, but these errors were encountered: