https://kotlinlang.org logo
#squarelibraries
Title
# squarelibraries
c

Colton Idle

07/02/2022, 3:45 PM
Json serialization question. I'm using firebase, and firebase has these things called httpscallables, which are essentially REST API calls, but theres no out of the box deserializer (although firebases firestore DOES deserialize things for you. it makes no sense.) Everything is returned as a Map<*, *>, and you're left to wire it up yourself into an object, OR take the map, convert map to json, then deserialize from json string into my actual object. I know I've read in the past that moshi optimizes for streams of data(? i think i read that somewhere) vs gson which optimizes for strings which is why sometimes benchmarks mislead with gson being faster. Since I need to do this weird dance of converting a map to json string first, then into an object. would gson actually be preferred in this case. or should i just stick with moshi (which i know fairly well) unless i hit a tangible perf issue with moshi?
5 Views