-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-pkgUsed for miscellaneous pkg/ packages not associated with specific area- teams.Used for miscellaneous pkg/ packages not associated with specific area- teams.pkg-jsonThe json macro packageThe json macro packagetype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
Currently json_codable assumes that a Map is passed to the fromJson constructor when that constructor is defined by the user.
This is not supported:
@JsonCodable()
class A {
final CustomStringSerialization customStringSerializationField;
}
class CustomStringSerialization {
final String a;
CustomStringSerialization(this.a);
String toJson() => a;
factory CustomStringSerialization.fromJson(String a) =>
CustomStringSerialization(a);
}
Use cases:
- deserializing values to object, for example a 'EUR' value could be deserialized to a currency object with its format method
- it will be necessary for enum support
Metadata
Metadata
Assignees
Labels
area-pkgUsed for miscellaneous pkg/ packages not associated with specific area- teams.Used for miscellaneous pkg/ packages not associated with specific area- teams.pkg-jsonThe json macro packageThe json macro packagetype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug