ApiImplicitBody throws error
See original GitHub issueI’m submitting a…
[ ] 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
When I put @ApiImplicitBody({name: 'choice'})
to a patch method I get the following error:
(node:22562) UnhandledPromiseRejectionWarning: TypeError: Cannot destructure property
prototype of 'undefined' or 'null'. at Object.exports.exploreModelDefinition (../node_modules/@nestjs/swagger/dist/explorers/api-parameters.explorer.js:78:27) at parameters.map.param (../node_modules/@nestjs/swagger/dist/explorers/api-parameters.explorer.js:190:35) at Array.map (<anonymous>) at mapModelsToDefinitons (../node_modules/@nestjs/swagger/dist/explorers/api-parameters.explorer.js:186:23) at exports.exploreApiParametersMetadata (../node_modules/@nestjs/swagger/dist/explorers/api-parameters.explorer.js:24:35) at explorers.reduce (../node_modules/@nestjs/swagger/dist/swagger-explorer.js:52:45) at Array.reduce (<anonymous>) at lodash_1.mapValues (../node_modules/@nestjs/swagger/dist/swagger-explorer.js:51:97) at ../node_modules/lodash/lodash.js:13400:38 at ../node_modules/lodash/lodash.js:4925:15 (node:22562) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:22562) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Expected behavior
@ApiImplicitBody decorator should work.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Environment
Nest Swagger version: 2.2.2
For Tooling issues:
- Node version: 9.4.0
- Platform: Mac
Others:
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
2.3.0
is available alreadyThis 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.