You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used you example in LazyAdaptersRetrofitTest but ended up with the following issue: if 'item' or 'item2' in the test "unwrapNestedJsonAdapter" contain more than one element, then in the "Nested" class you have to do something like:
Sorry for the late reply. Somehow I missed this in my notifications.
This will not work since moshi consumes the json field as soon as it's parsed.
You can probably work around this, by creating your own WrappedJsonAdapter that will leverage from this https://github.com/square/moshi/blob/master/moshi/src/main/java/com/squareup/moshi/JsonReader.java#L420. The idea would be to first read the full json that contains the field item with readJsonValue() (essentially buffering everything in a map) and then parsing it twice. I didn't try it my self, and not 100% sure if that will work, but it may work.
Hi,
I used you example in LazyAdaptersRetrofitTest but ended up with the following issue: if 'item' or 'item2' in the test "unwrapNestedJsonAdapter" contain more than one element, then in the "Nested" class you have to do something like:
But then you get an exception from Moshi saying there are conflicting fields because of the 2 "item".
Am I missing something ?
The text was updated successfully, but these errors were encountered: