> +      @Override
> +      public Image deserialize(JsonElement jsonElement, Type type, 
> JsonDeserializationContext context)
> +              throws JsonParseException {
> +         JsonObject json = jsonElement.getAsJsonObject();
> +
> +         Map<String, Object> complexMetatdata = null;
> +         Map<String, String> metadata = null;
> +         JsonElement meta = json.get(METADATA);
> +         if (meta != null && meta.isJsonObject()) {
> +            metadata = Maps.newTreeMap();
> +            complexMetatdata = Maps.newTreeMap();
> +            for (Map.Entry<String, JsonElement> e : 
> meta.getAsJsonObject().entrySet()) {
> +               Object value;
> +               if (e.getValue().isJsonArray()) {
> +                  value = context.deserialize(e.getValue().getAsJsonArray(), 
> ArrayList.class);
> +               } else if (e.getValue().isJsonObject()) {

D'oh! Good point about the additional unit test for the JsonObject case, I'll 
get that added ASAP. I'm not sure about testing the class directly though, I'd 
actually considered doing that originally but the other adapters didn't have 
any unit tests. I figured that would have just been overkill, but I'm happy to 
add one if you guys think it's necessary.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/626/files#r21995629

Reply via email to