Closed seclace closed 4 years ago
P.S. Should I create this issue for @nestjs/swagger repo or swagger-ui-express?
This issue should be reported in the swagger-ui-express
repo
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I'm submitting a...
Current behavior
Request from Swagger-UI sends optional parameters anyway. So then the server throws an error that optional fields are validated with errors and responds with 400 status code. From new Swagger-UI:
From old Swagger-UI:
Expected behavior
Swagger-UI should not send optional parameters if they are not filled. (In previous release of swagger 2.0 it was working correctly)
Minimal reproduction of the problem with instructions
Add use of
@ApiBody()
decorator to any controller's endpoint:dto/my-type.dto.ts
:my-controller.controller.ts
:What is the motivation / use case for changing the behavior?
Environment
Other helpful infos
I'm using Nest.js' monorepo feature. Swagger plugin is enabled in nest-cli.json
P.S. Should I create this issue for
@nestjs/swagger
repo orswagger-ui-express
?