Swagger plugin incorrectly parses optional fields
See original GitHub issueI’m submitting a…
[x] 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.
Minimal reproduction of the problem with instructions
- Enable “@nestjs/swager/plugin”
- Create following DTO
OptonalPropDto {
field?: string;
}
- Check output swagger document
"OptonalPropDto ": {
"type": "object",
"properties": {
"field": {
"type": "object"
}
}
}
Field type should have “string” value.
What is the motivation / use case for changing the behavior?
Environment
Downgrading @nestjs/cli helps to resolve the issue.
"@nestjs/swagger": "4.2.8"
"@nestjs/cli": "6.14.2"
For Tooling issues:
- Node version: 12.15
- Platform: Windows
Others:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Optional object field in Dto does not parse to optional with ...
I have installed the @nestjs/swagger/plugin in nest-cli.json and it has been up running fine. Creating an optional field with ? symbol on ...
Read more >Swagger parsing fails due to format suffix generated by ...
Anyone have ideas on how to help? Are my docs wrong or am I using the parser wrong? swagger · swagger-maven-plugin.
Read more >Swagger: Specify Two Responses with the Same ...
Learn how to write an API specification that returns two different objects for the same response code using Java and Swagger.
Read more >Integrating Swagger UI with the rest of your docs
Whenever discussions about Swagger and other REST API specifications ... Option 3: Parse the OpenAPI specification document; Option 4: Store ...
Read more >ReadMe: OpenAPI and Swagger for API Documentation
After Swagger became the de facto standard for API definition, the industry recognized the need for a vendor-neutral option. In 2016, developer ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It should be fixed in 4.2.11
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.