should this mapping be just thrown in FooRepositor...
# android-architecture
u
should this mapping be just thrown in FooRepository or should the be some wrapper around retrofitApi interface?
h
we have custom jackson (de)serializer handles this stuff. Other libraries has similar solutions.
u
Deserializer for what exactly, json directly to db model?
u
You should take a look at this guide. https://futurestud.io/tutorials/gson-advanced-customizing-de-serialization-and-adding-instance-creators-via-jsonadapter. I think that gson actually has a default handling of just using the enum name but this might not be what you want and in that case you need to add a type adapter to gson.
u
Sorry, I meant query params etc, not json request body. If there was some preprocessor like so, it would be nice, but it is not, so im asking at what layer would you guys do this, since I feel like doing it in repository leaks the api details there for no reason