typestack / class-transformer

Decorator-based transformation, serialization, and deserialization between objects and classes.
MIT License
6.66k stars 487 forks source link

plainToClassFromExist is Deprecated what is the replacement for generics? #1653

Closed charlesritchea closed 2 months ago

charlesritchea commented 7 months ago

I was trying to... deserialize a generic collection

The problem: plainToClassFromExist works, but is marked deprecated; however, I don't see any replacement

diffy0712 commented 3 months ago

The deprecation comment is saying that

This function is being removed. The current implementation is incorrect as it modifies the source object.

According to the code there is no one-to-one replacement, which can be a problem if you need to populate an instance. You can use plainToInstance, but that will create a new instance.

diffy0712 commented 2 months ago

Closing as answered. If you have any questions left feel free to comment on this issue.

github-actions[bot] commented 1 month ago

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.