> Out of curiosity: what is the GSON limitation here?

GSON always deserializes numbers as a float number (older versions used to 
deserialize to the minimum needed type, i.e. 1 will get deserialized as 1 
instead of 1.0; now 1 and 1.0 will be deserialized as 1.0). 
For the requests, the service will not accept "1.0" or 1.0 in the request where 
an integer is needed.

> Are we making them artificially simple by hiding the complexity of the type 
> of the field in lots of other places in the code?

I am fairly certain that the answer is no. They are just structured in a 
somewhat weird way. Because the service is still being worked on, I am under 
the impression that structure might change in the future (and become more 
straightforward). 
I have decided for now it is better to decouple the parsing logic from the 
domain classes. When the service becomes stable, it is quite possible much of 
the parsing logic can be eliminated (especially if the JSON gets restructured). 
This has already happened when comparing request/responses versus earlier 
versions of autoscale for some calls.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/39#issuecomment-27342806

Reply via email to