AutoValue types are abstract classes, a documented tough spot in gson serialization. Usually, the answer is registering a type hierarchy adapter for each type. This is unsustainable with value types as they are often small and nested.
Luckily, auto-value is a constrained domain. They are abstract classes with a builder method, and we tag that method with `@SerializedName`. These types can never validly have multiple subclasses, nor be parameterized, etc. Moreover, they have a very specific naming convention. Long story short, rather than try to make gson support any given abstract type, handling auto-value is kindof easy and not fragile either. The approach in this PR works! You can merge this Pull Request by running: git pull https://github.com/adriancole/jclouds adrian.auto-serialization Or you can view, comment on it, or merge it online at: https://github.com/jclouds/jclouds/pull/594 -- Commit Summary -- * JCLOUDS-750 support serializing auto-value types without custom type adapters. -- File Changes -- M core/pom.xml (5) M core/src/main/java/org/jclouds/json/internal/DeserializationConstructorAndReflectiveTypeAdapterFactory.java (18) M core/src/test/java/org/jclouds/json/JsonTest.java (54) M project/pom.xml (6) -- Patch Links -- https://github.com/jclouds/jclouds/pull/594.patch https://github.com/jclouds/jclouds/pull/594.diff --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/594
