Allow type coercion when determining API types #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we read objects from the API, we want to ensure the type matches
either the type class that the client is aware of, or whatever the
complexType property on the object tells us. In some cases, the API
returns a type for a property that is not the same or a subtype of the
type defined by the API. The API should not do this, however the
previous behavior was to throw an exception in these cases, which is
quite annoying. Instead, we will now coerce the object we get into the
type that the definition says. If properties are missing, they will
remain unset, and any extra properties will be added to the unknown
properties.
Fixes #63