@Body not pulling model without @ApiImplicitBody
See original GitHub issueI’m submitting a…
[ ] Regression
[x] Bug report
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
As described by #65, I followed the NestJS Swagger walkthrough and my model did not show up with only using @Body, and began to work correctly after using @ApiImplicitBody
as described in #65.
Expected behavior
Model should come through as described by the NestJS swagger docs walkthrough.
Minimal reproduction of the problem with instructions
- Spin up Nest project inside an Nx project
- Add and setup nestjs/swagger
- Setup controller with a @Post and a @Body
- Setup DTO with
@ApiModelProperty
- Observe in the Swagger docs, no model comes through
- Add
@ApiImplicitBody
as described in #65 - Observe in the Swagger docs, a model now comes through
What is the motivation / use case for changing the behavior?
Hope to use as it’s described, don’t want to use @ApiImplicitBody
if it’s not required.
Environment
Nest version: 5.5.0
Nest/Swagger version: 2.5.1
For Tooling issues:
- Node version: 10.15.3
- Platform: Mac
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Explicit types in Request Body not showing up in Swagger ...
If I replace the inline definition with a class with @ApiProperty() annotations it works. However, I want to find a way without using...
Read more >@nestjs/swagger - npm
Nest - modern, fast, powerful node.js web framework (@swagger). Latest version: 6.1.4, last published: 20 days ago.
Read more >How to use the @nestjs/swagger.ApiOperation function in ...
Use Snyk Code to scan source code in minutes - no build needed - and fix issues ... based on the incoming body'...
Read more >OpenAPI (Swagger) | NestJS - A progressive Node.js framework
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines ...
Read more >dojo/request a png image array buffer using NodeJS, and ...
request({ url: yoururl, method: 'GET', encoding: null }, function (error, response, body) { if (!error && response.statusCode === 200) { res.send(response.
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
@Kanti look this it! Change in the file of project tsconfig.json where “target”: “es5” to “target”: “es6” it is solved!
Hi, We have the same Problem. I made a repository for you @kamilmysliwiec: https://github.com/Kanti/nestjs-swagger-bug-demo