You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
⚠️ Note that functions will only be called once when the API docs are generated, so you cannot add values dynamically after application startup.
What is the motivation / use case for changing the behavior?
We want to be able to add enum values by adding an decorator on some other nestjs component in our case a typeorm entity, we do not want to have to remember to update the possible enum values.
The text was updated successfully, but these errors were encountered:
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
We are using some dynamic code to find all of the possible values of an enum i.e.
However since the
enum
option of@ApiProperty
expects a static function and not a function, the result is dependent on the order of import of modules.Describe the solution you'd like
Modification of enum property type to
Teachability, documentation, adoption, migration strategy
Current users => 0 impact.
New users can use function for enum values if wished.
I suggest a docs change to:
To identify an enum, we must manually set the enum property on the @ApiProperty with an array of values or a function returning an array of values.
What is the motivation / use case for changing the behavior?
We want to be able to add enum values by adding an decorator on some other nestjs component in our case a typeorm entity, we do not want to have to remember to update the possible enum values.
The text was updated successfully, but these errors were encountered: