-
Enhancement
-
Resolution: Done
-
Major
-
None
-
None
When unmarshalling responses from the server there are among other objects links that shall get created. Links look like the following:
"links":{ "UPDATE":{ "href":"/domains/foobar", "optional_params":[ ], "required_params":[ { "name":"id", "valid_options":[ ], "description":"Name of the domain", "type":"string" } ], "method":"PUT", "rel":"Update domain" ...
The unmarshalling code currently turns the "type" property into an enum. If the type that's provided is not known, then an exception is thrown:
public enum LinkParameterType { STRING, BOOLEAN, INTEGER, ARRAY; public static LinkParameterType valueOfIgnoreCase(String name) throws OpenShiftRequestException { if (name == null) { // no type provided (this is valid, not an error) return null; } try { return valueOf(name.toUpperCase()); } catch(IllegalArgumentException e) { throw new OpenShiftRequestException("Unknow request parameter type {0}", name); } }
This is not a good approach. The client library should be tolerant, it should ignore things it doesn't know to ensure it works with future responses. This is even more true as responses evolve over time even in the same protocol version: OpenShift is backporting new features (additions only) to old protocols!
- is related to
-
JBIDE-15396 cannot log into OpenShift (even though credentials are valid)
- Closed