问题
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
回答1:
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.
来源:https://stackoverflow.com/questions/36204499/moshi-ignore-field