-
Notifications
You must be signed in to change notification settings - Fork 393
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
@QueryParam enum support #208
Comments
PRs are accepted for this feature |
Can you show how the |
|
Sorry for the delay ! My enum is a string enum:
which produces a JS enum like so:
I made a PR (which was accepted) a few weeks ago that added support for string enums to the To be reopened ? |
Nope, TS 2.4 string enums works in runtime just like the old enums, nothing changed, just no need for |
Right, but why close this issue since it is tagged as "new-feature" ? Will you still accept PRs ? |
String enums have reflected types as String, so now it should be normalized to a string, not as a NaN (normal enums are numbers in runtime). If you need validator on query param, you should use |
Sweet, I didn't know there was an |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hello,
@QueryParam('type') type: MyEnum
will always settype
toNaN
. Otherwise, doing@QueryParam('type', {type: OperationType}) type: OperationType
throws an error, since enums do not have constructors.My current workaround is:
and
Thanks for the amazing work !
The text was updated successfully, but these errors were encountered: