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
As you can see, extra @ApiParam decorators are needed to help Swagger understand the fact that both tenantId and id params are expected to be uuid. But this information could be infer by the fact that we're using ParseUUIDPipe in @Param.
Describe the solution you'd like
It would be great to not have to repeat the same information twice. While generating the Swagger document, the exploration process should be able to deduce that @Param("id", ParseUUIDPipe) means that the id param is an UUID.
Therefore, @ApiParam decorators would not be needed anymore, and the resulting code would be more lightweight, while providing the precise information in the final Swagger doc:
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
Hi
Nest.js controller handlers often have to deal with UUIDs in the params. Here's an example:
As you can see, extra
@ApiParam
decorators are needed to help Swagger understand the fact that bothtenantId
andid
params are expected to be uuid. But this information could be infer by the fact that we're usingParseUUIDPipe
in@Param
.Describe the solution you'd like
It would be great to not have to repeat the same information twice. While generating the Swagger document, the exploration process should be able to deduce that
@Param("id", ParseUUIDPipe)
means that theid
param is an UUID.Therefore,
@ApiParam
decorators would not be needed anymore, and the resulting code would be more lightweight, while providing the precise information in the final Swagger doc:Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
DRY code.
Thanks
The text was updated successfully, but these errors were encountered: