swagger
swagger copied to clipboard
ApiOperation overrideExisting leaves existing data
Is there an existing issue for this?
- [X] I have searched the existing issues
Current behavior
When I provide overrideExisting: true some existing ApiOperation data is preserved.
This prevents using
@ApiOperation({
$ref: "..."
})
because when using $ref you cannot have any other fields.
Minimum reproduction code
Can create if needed, but the issue is pretty straightforward
Steps to reproduce
- Put ApiOperation decorator on a method.
@ApiOperation({
...
})
-
Open the generated OpenAPI JSON
-
See that there are other things in the operation that the ones provided in the decorator
Expected behavior
Only the provided data in ApiOperation would be in OpenAPI document if I choose overrideExisting: true
Package version
7.4.2
NestJS version
10.4.4
Node.js version
22
In which operating systems have you tested?
- [ ] macOS
- [ ] Windows
- [X] Linux
Other
No response