fix: instanceToPlain fails when union discriminator type is read-only #944
Labels
status: needs triage
Issues which needs to be reproduced to be verified report.
type: fix
Issues describing a broken feature.
Description
When we use immutable helper libraries, like immer, the discriminator property on the instance may be frozen.
In this case
instanceToPlain
(in class-transformer 0.4.0) fails with:Minimal code-snippet showcasing the problem
Expected behavior
Converting to plain should not fail (even for frozen instances).
Actual behavior
instanceToPlain
(in class-transformer 0.4.0) fails with:The text was updated successfully, but these errors were encountered: