Open a14n opened 3 months ago
Summary: The JsonCodable
annotation currently uses Map<String, Object?>
for serialization, causing issues when custom types like Decimal
require specific input formats. The user suggests using the type specified in Xxx.fromJson
to determine the serialization format.
On decimal package someone reported an issue with JsonCodable. He tried the following code:
As
Decimal.fromJson
accepts String as parameter he get an error because the generated code use aMap<String, Object?>
as input.It would be great if JsonCodable could read the type present in
Xxx.fromJson
and use it as serialization format.