Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support for multiple api decorators on schema class #3165

Merged

Conversation

arabold
Copy link
Contributor

@arabold arabold commented Nov 13, 2024

Support multiple @ApiExtension decorators on the schema class. This implementation applies the same fix as #1525 but also for the class, not just for the member functions.

This enables you do use multiple @ApiExtension (and other mixed decorators) on an API schema definition like this:

@ApiExtension('x-foo', { test: 'test' })
@ApiExtension('x-bar', { test: 'test' })
class CatDto {
}

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Currently it is not possible to use the same decorator multiple times on the same class. I.e. using two @ApiExtension() decorators will only result in the first one being applied.

Issue Number: N/A

What is the new behavior?

This PR fixes this behavior and applies all decorators as expected. It implements the same fix as #1525 but on a class level.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Support multiple @APIextension decorators on the schema class.
@kamilmysliwiec kamilmysliwiec merged commit fe0adc3 into nestjs:master Nov 15, 2024
1 check passed
@kamilmysliwiec
Copy link
Member

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants