@nestjs/swagger
Advanced tools
Comparing version 5.0.6 to 5.0.8
@@ -32,5 +32,10 @@ "use strict"; | ||
} | ||
const apiOperationDecoratorsArray = this.createApiOperationDecorator(factory, compilerNode, compilerNode.decorators, options, sourceFile, typeChecker); | ||
const removeExistingApiOperationDecorator = apiOperationDecoratorsArray.length > 0; | ||
const existingDecorators = removeExistingApiOperationDecorator | ||
? compilerNode.decorators.filter((item) => ast_utils_1.getDecoratorName(item) !== decorators_1.ApiOperation.name) | ||
: compilerNode.decorators; | ||
return factory.updateMethodDeclaration(compilerNode, [ | ||
...this.createApiOperationDecorator(factory, compilerNode, compilerNode.decorators, options, sourceFile, typeChecker), | ||
...compilerNode.decorators, | ||
...apiOperationDecoratorsArray, | ||
...existingDecorators, | ||
factory.createDecorator(factory.createCallExpression(factory.createIdentifier(`${plugin_constants_1.OPENAPI_NAMESPACE}.${decorators_1.ApiResponse.name}`), undefined, [ | ||
@@ -66,5 +71,14 @@ this.createDecoratorObjectLiteralExpr(factory, compilerNode, typeChecker, factory.createNodeArray(), hostFilename) | ||
]); | ||
return [ | ||
factory.createDecorator(factory.createCallExpression(factory.createIdentifier(`${plugin_constants_1.OPENAPI_NAMESPACE}.${decorators_1.ApiOperation.name}`), undefined, apiOperationDecoratorArguments)) | ||
]; | ||
if (apiOperationDecorator) { | ||
const expr = apiOperationDecorator.expression; | ||
const updatedCallExpr = factory.updateCallExpression(expr, expr.expression, undefined, apiOperationDecoratorArguments); | ||
return [ | ||
factory.updateDecorator(apiOperationDecorator, updatedCallExpr) | ||
]; | ||
} | ||
else { | ||
return [ | ||
factory.createDecorator(factory.createCallExpression(factory.createIdentifier(`${plugin_constants_1.OPENAPI_NAMESPACE}.${decorators_1.ApiOperation.name}`), undefined, apiOperationDecoratorArguments)) | ||
]; | ||
} | ||
} | ||
@@ -71,0 +85,0 @@ return []; |
{ | ||
"name": "@nestjs/swagger", | ||
"version": "5.0.6", | ||
"version": "5.0.8", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@swagger)", | ||
@@ -5,0 +5,0 @@ "author": "Kamil Mysliwiec", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
232469
4666