swagger icon indicating copy to clipboard operation
swagger copied to clipboard

ApiOperation overrideExisting leaves existing data

Open SmallhillCZ opened this issue 1 year ago • 0 comments

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

  1. Put ApiOperation decorator on a method.
@ApiOperation({
  ...
})
  1. Open the generated OpenAPI JSON

  2. 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

SmallhillCZ avatar Oct 17 '24 16:10 SmallhillCZ