softlayer-java icon indicating copy to clipboard operation
softlayer-java copied to clipboard

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

Open allmightyspiff opened this issue 6 years ago • 2 comments

When getting a list of operating systems from the API, if a safenet (HSM) type device is in the list, the following error will be present.

Expecting class com.softlayer.api.service.software.component.OperatingSystem to be super type of class com.softlayer.api.service.software.component.security.SafeNet

https://sldn.softlayer.com/reference/datatypes/SoftLayer_Software_Component_Security_SafeNet/ should inherit from the OperatingSystem, but is instead inherits from the Security Class.

allmightyspiff avatar Mar 23 '20 16:03 allmightyspiff

The workaround I think we can do is to return as common a supertype as we can derive from both the expected and actual types.

camporter avatar Mar 23 '20 16:03 camporter

Well, we obviously can't use a common supertype 😄 that violates the existing contracts. Instead, allow coercing the returned object into the type that's defined.

camporter avatar Mar 23 '20 23:03 camporter