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
[ ] Regression
[ x ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
In some situations a boolean field in a DTO class is annotated as an object by the swagger plugin in the API schema. I didn't manage to identify the exacts circumstances where this happens, it probably only occurs when the field is marked as optional ( annotated with a ? ), and it probably never occurs when the field is marked with the ApiPropertyOptional decorator.
This has been already posted by another user in the Nest repo ( nestjs/nest#4913 ) and by me in the Discord channel.
Minimal reproduction of the problem with instructions
The DTO class for which the bug occurs is the PaginationDto class in the src/common/common.dto.ts file. The field count has type boolean but when I start the server ( with Nest CLI, swagger plugin enabled ) and look at the generated swagger schema it is marked as an object.
Environment
Nest version: 7.0.0
For Tooling issues:
- Node version: v12.13.1
- Platform: Mac
The text was updated successfully, but these errors were encountered:
I'm submitting a...
Current behavior
In some situations a
boolean
field in a DTO class is annotated as anobject
by the swagger plugin in the API schema. I didn't manage to identify the exacts circumstances where this happens, it probably only occurs when the field is marked as optional ( annotated with a?
), and it probably never occurs when the field is marked with theApiPropertyOptional
decorator.This has been already posted by another user in the Nest repo ( nestjs/nest#4913 ) and by me in the Discord channel.
Minimal reproduction of the problem with instructions
I didn't manage to reproduce the bug in a brand new Nest app, but I published the sample project I was working on the last time I faced the bug: https://github.com/darioielardi/nest-swagger-boolean-bug
The DTO class for which the bug occurs is the
PaginationDto
class in thesrc/common/common.dto.ts
file. The fieldcount
has typeboolean
but when I start the server ( with Nest CLI, swagger plugin enabled ) and look at the generated swagger schema it is marked as anobject
.Environment
The text was updated successfully, but these errors were encountered: