Merge: json::serialization: don't raise errors on missing attributes with default...
authorJean Privat <jean@pryen.org>
Thu, 1 Sep 2016 01:53:15 +0000 (21:53 -0400)
committerJean Privat <jean@pryen.org>
Thu, 1 Sep 2016 01:53:15 +0000 (21:53 -0400)
commit9b56120ddb7796a90245b96b73ffee236d112e5a
tree874dbbea09b917daf31defea5a97772c11383c12
parent262a277afc7149e36054781fbaee7edbd388135c
parent9576ee4010a37d73d4fb18b2ddd33ad1bb24d791
Merge: json::serialization: don't raise errors on missing attributes with default values

This PR fits in the ongoing work to improve deserializing from plain JSON objects.

The JSON deserialization engine no longer raises errors on missing attributes when a default value is available. Attributes may be missing because the JSON object come from a third-party API or
when loading serialized data from a previous version of the software. Default values include simple default values (`var x = 4`), lazy attributes and nullable types (which are set to `null`). This does not yet include `optional` attributes, more work would be needed.

The test/example can be activated when #2296 is fixed.

Pull-Request: #2302
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>