question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@Body not pulling model without @ApiImplicitBody

See original GitHub issue

I’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

  1. Spin up Nest project inside an Nx project
  2. Add and setup nestjs/swagger
  3. Setup controller with a @Post and a @Body
  4. Setup DTO with @ApiModelProperty
  5. Observe in the Swagger docs, no model comes through
  6. Add @ApiImplicitBody as described in #65
  7. 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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
carloscfcortezcommented, Jun 19, 2019

@Kanti look this it! Change in the file of project tsconfig.json where “target”: “es5” to “target”: “es6” it is solved!

4reactions
Kanticommented, Apr 22, 2019

Hi, We have the same Problem. I made a repository for you @kamilmysliwiec: https://github.com/Kanti/nestjs-swagger-bug-demo

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found