Actually throwing errors during deserialization can make it very hard to debug an issue if the is a deserialization issue, even if that deserialization issue can be safely ignored. We eventually handle these exceptions anyways and surface messages, so this simply does that explicitly.
This really only affects working with local Elements, but this is frequent enough to be annoying.
Doesn't allow null values when deserializing
DESCRIPTION:
Create a _deserializationDiscriminatorWarnings list that saves a list of deserialization issues encountered, rather than throwing for each one encountered.
Makes Element a concrete class so we can instantiate it instead of returning null
TESTING:
Updated tests in the ModelTests to turn unknown types into the base class of Element with Name and Id assigned and all AdditionalProperties are assigned.
FUTURE WORK:
We could do things now when we don't have the right Element type for deserialization... we can still get at the properties of the base Element through AdditionalProperties
BACKGROUND:
DESCRIPTION:
Element
a concrete class so we can instantiate it instead of returning nullTESTING:
Element
withName
andId
assigned and allAdditionalProperties
are assigned.FUTURE WORK:
Element
type for deserialization... we can still get at the properties of the baseElement
throughAdditionalProperties
REQUIRED:
CHANGELOG.md
.COMMENTS:
This change is![Reviewable](https://reviewable.io/review_button.svg)