rharter / auto-value-gson

AutoValue Extension to add Gson De/Serializer support
Apache License 2.0
607 stars 103 forks source link

Ability to work with Hal JSON #64

Closed aegis123 closed 5 years ago

aegis123 commented 8 years ago

Hi I was wondering how you think about adding functionality to handle support for HAL json, gson doesn't support it in a workable way. When you model all the classes as the json it works with gson but that means you would have to write a lot of model classes or really big model classes. There is a library halarious that works with gson to enable parsing of hal json but it doesn't work properly with AutoValue gson since it works with runtime reflection and adding JsonSerializer/JsonDeserializer for the same classes as the generated AutoValue. This defeats the purpose of creating the generated streaming parsers in the TypeAdapters.

I forked your extension and added 2 Annotations that are basically copies of SerializedName when adding those to your abstract methods instead of the SerializedName the code generation is a little bit different.

Do you think this would be a nice functionality to have or do you have other recommendations to get this working?

ZacSweers commented 5 years ago

Quite late to this, but I think this is out of scope for the project. Sorry!

Also - doesn't gzip solve that problem?