In order to parse this to json using Moshi do I ha...
# squarelibraries
l
In order to parse this to json using Moshi do I have to use PolymorphicJsonAdapter?
Copy code
sealed class PaymentMethod
sealed class CreditCard : PaymentMethod()

data class Card(val field:String): CreditCard()
data class UntokenizedCard(val field:String,val field2String): CreditCard()

// How to parse this request  to accept either Card/ UntokenizedCard objects
data class RetrofitRequest(something:Something)
I tried to write one but not sure if I fully understand how to parse to become either
Copy code
"credit-card" : {
      "cvc-code" : "999",
      "expiration-date" : "12/2019",
      "number" : "1234 1234 1234 1234",
      "type" : "VISA"
   }
or 
"credit-card" : {
      "identifier": "AAAA"
      "cvc-code" : "999"
   }