Provides post-processing of generic model instances after they have gone through the standard
JSON deserialization. This consists of the following:
- For any field with an
Option type, if the field's value is null (meaning that the
field was omitted in the JSON document) we set it to none(). This is necessary because
there's no concept of default values in Gson.
- For any field with a
@RequiredLink annotation, we look for the corresponding link
within the _links property and set it to that value, or signal an error if the link is
missing. This ensures, for instance, that an object can promise that it always has a self
link and we will never return an instance that does not.
- For any other field, if its value is null we signal an error. Thus, no model properties are
nullable; optional fields must always use
Option.