Improvement for record deserialization/serialization from/to json #528
Labels
Area/Langext
Relates to annotations providing language extras
Type/Improvement
Enhancement to language design
Milestone
Description:
In the current JSON to record conversion with .constructFrom requires exact matches in field names. Because of this restriction at certain times, we need to manually go through the JSON, retrieve and update the record. It would be good if we can configure the mapping json key for a particular field in the record beforehand and do the conversion using 'constructFrom'.
For example, in the following record, I need to map JSON's
unit_amount
field to record's 'unitAmount' field andunit_amount_decimal
to 'unitAmountDecimal'.Ex:
This will be useful when dealing with json payloads coming from third-party servers because some JSON responses have fields with underscores.
The text was updated successfully, but these errors were encountered: