jessewilson
01/12/2022, 11:45 PMclass Payment {
String currency = "USD";
long amount;
public Payment(long amount) {
this.amount = amount;
}
}
Moshi decodes {"amount": 100}
to a Payment
with a null
currency! We’re doing nasty things because Moshi works field-by-field and there’s no nice way to map field names to constructor parameter names.