Skip to content

Conversation

@camporter
Copy link
Member

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

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.
@camporter camporter changed the title Allow type coercion when determining APi types Allow type coercion when determining API types Mar 23, 2020
@allmightyspiff allmightyspiff merged commit a282afc into master Mar 24, 2020
@camporter camporter deleted the allow_api_typeclass_coercion branch September 16, 2021 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

com.softlayer.api.service.software.component.security.SafeNet needs to inherit from OperatingSystem

3 participants