-
Notifications
You must be signed in to change notification settings - Fork 474
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
Incorrect enum type always 'array' #2615
Labels
Comments
Would you like to create a PR for this issue? |
I'm afraid I'm not sure I'll find the time at the moment |
This appears to have been introduced by this change: Previously, this would always assume that the enum was a string. Now that it takes into account the declared type, it can erroneously be set as an array. |
IodizedGabe
added a commit
to IodizedGabe/swagger
that referenced
this issue
Oct 3, 2023
If an enum property is decorated with `isArray: true`, its type should be derived from the type of the enum item, rather than as an `array`.
12 tasks
kamilmysliwiec
added a commit
that referenced
this issue
Oct 4, 2023
…sed-enum fix(): Derive enum types correctly when defined as an array #2615
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Current behavior
When specifying
ApiPropertyOptions
enum the OAS now always now specifies the type to be 'array' instead of what it actually is. Seems to be happening when there is an @ApiProperty({ isArray: true }) referencing it.This was introduced in version 7.1.8, it was working fine before
Minimum reproduction code
https://github.com/alexandrulesi/nestjs-bug-repro
Steps to reproduce
Expected behavior
Enum types should be what it is, in this case string, and not array
You can also check the json dumps for comparison
Package version
7.1.11
NestJS version
No response
Node.js version
No response
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: