Is there a simple way to ignore a field when using moshi to serialize to a json string? I can only think about is a custom adapter - but I have the feeling that there is a better way
Use transient
on the field declaration.
private transient String your_variable_name;
Originally I found Exclude fields from serialization and deserialization
Hope It's help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With