swagger icon indicating copy to clipboard operation
swagger copied to clipboard

feat: add function for enum types

Open slukes opened this issue 9 months ago • 2 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
  • [x] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [ ] Bugfix
  • [x] 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 using enum values that are dynamic, the value returned depends on the order that modules are imported in

Issue Number: https://github.com/nestjs/swagger/issues/2786

What is the new behavior?

enum can be a function which is called at the moment that the document is generated.

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

Other information

slukes avatar Apr 29 '24 21:04 slukes