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

Labels

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

@camporter@allmightyspiff