Skip to content

fix(decorators): do not crash on Controller getter#3788

Open
robbtraister wants to merge 1 commit intonestjs:masterfrom
robbtraister:bugfix/api-query-with-getter
Open

fix(decorators): do not crash on Controller getter#3788
robbtraister wants to merge 1 commit intonestjs:masterfrom
robbtraister:bugfix/api-query-with-getter

Conversation

@robbtraister
Copy link
Copy Markdown

getter descriptors use the .get field rather than .value. If an @ApiQuery-decorated Controller has a getter, we should ignore the getters when applying the decoration to its members.

This change will prevent these types of Controllers from crashing on startup.

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?

When a controller is decorated with @ApiQuery() and also contains a getter, the app will crash on startup.

Issue Number: N/A

What is the new behavior?

When a controller is decorated with @ApiQuery() and also contains a getter, the app will start as expected.

Does this PR introduce a breaking change?

  • Yes
  • No

getter descriptors use the `.get` field rather than `.value`.
If an @ApiQuery-decorated Controller has a getter, we should ignore the
getters when applying the decoration to its members.

This change will prevent these types of Controllers from crashing on
startup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant