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
It would be nice instead of having to call plainToClass with enableImplicitConversion: true, in certain situations across the codebase, if I could mark the property or even all properties of a certain class to always function as if enableImplicitConversion: true. This is specifically an issue in nested transformations, where I have a deeply nested class that I want implicit conversions to take place for a property with type Moment., as it is already in moment form from the form and will throw an error otherwise.
Proposed solution
Add a decorator such as @EnableImplicitTypeConversion() that can mark a property or class to act as though implicit conversion was enabled in the call of plainToClass. I will say that this should act as a default and any value provided in the actual plainToClass call should probably take precedent or have an extra option to override, but that's more of your decision on how that can/should be handled.
The text was updated successfully, but these errors were encountered:
Decorators will be added to cast primitive values during the transformation. (See #550) For non-primitive values, you should use a @Type or @Transform decorator.
Your requested feature @EnableImplicitTypeConversion() won't be implemented as you can easily replicate it with a @Type or Transform decorator.
Description
It would be nice instead of having to call plainToClass with enableImplicitConversion: true, in certain situations across the codebase, if I could mark the property or even all properties of a certain class to always function as if enableImplicitConversion: true. This is specifically an issue in nested transformations, where I have a deeply nested class that I want implicit conversions to take place for a property with type Moment., as it is already in moment form from the form and will throw an error otherwise.
Proposed solution
Add a decorator such as
@EnableImplicitTypeConversion()
that can mark a property or class to act as though implicit conversion was enabled in the call of plainToClass. I will say that this should act as a default and any value provided in the actual plainToClass call should probably take precedent or have an extra option to override, but that's more of your decision on how that can/should be handled.The text was updated successfully, but these errors were encountered: