Top "Moshi" questions

Moshi is a JSON library for Android and Java.

How to make "inappropriate blocking method call" appropriate?

I am currently trying to leverage kotlin coroutines more. But I face a problem: when using moshi or okhttp inside …

kotlin okhttp kotlin-coroutines moshi
Moshi vs Gson in android

I'm deciding on whether to use Moshi by square or Gson to serialize and deserialize model data. one thing i …

android gson deserialization moshi
Custom converter to subclass with Moshi

I have a User class. And two subclasses. Parent and Child. I get json from my server with {"user":"..."} and …

android square moshi
How to serialize an Object to Map by Moshi

I want to serialize an Object to Map by Moshi.Here is my codes by Gson public static Map<…

moshi
Turn string date from json to a Date object with Moshi

with Gson you would do this Gson gson = new GsonBuilder() .setDateFormat("yyyy-MM-dd'T'HH:mm") .create(); and pass it to the retrofit …

android retrofit2 moshi
Moshi ignore field

Is there a simple way to ignore a field when using moshi to serialize to a json string? I can …

json moshi
Moshi KotlinJsonAdapterFactory cannot parse Json after enabled minify

I have developed an Android app, using Moshi as one of its dependencies. Today I want to enable minify for …

android kotlin minify moshi
Moshi ignore field in Kotlin

I want to know how to ignore a Kotlin class field when using Moshi. I've found this answer for Java (…

json kotlin ignore serialization moshi
Moshi Expected BEGIN_OBJECT but was BEGIN_ARRAY - custom converter ignored

I'm using Moshi as converter for Retrofit, but for one particular request it doesn't work and exception is thrown: com.…

java json retrofit2 moshi