Closed FufferKS closed 3 months ago
I assume you do creditCard.toMap()
or .toJson()
.
To fix this right now you can do CreditCardMapper.ensureInitialized().encodeMap(creditCard, EncodingOptions(includeTypeId: false)));
or .encodeJson(...)
The __type
is added in certain cases where it is needed so that x == X.fromMap(x.toMap())
. However this should disregard type mismatches that only differ in nullability. So I consider this a bug and work on a fix.
Thanks for the reply. I am encoding to json, but I'm using a mix of freezed and mappable (slowly migrating to your solution), plus the credit card is one of many types of products, so I don't see an easy way to pass those exclusions. It doesn't hurt that bad, so I will wait for the fix. Thanks!
Already landed in 4.2.2 😁✌️
Amazing!
🙌
Hi!
I have the following core class:
and this business one:
In runtime, at one point apr is being assigned a
Snapshot<Decimal>
- not null. This causes my json request to include"__type": "Snapshot<Decimal>"
which seems redundant.Is there an option to ignore it?