phil-t
03/03/2022, 4:48 PM@JsonAlias("data")
to two fields in my class so that I can have separate data classes representing the underlying data, but this doesn’t work - the alias seems to apply to one field or the other. I’ve tried these two methods so far but neither work:
data class MyResponse(
@JsonAlias("data")
val dataOne: dataClassOne?,
@JsonAlias("data")
val dataTwo: dataClassTwo?
)
data class MyResponse(
@JsonAlias("data")
val dataOne: dataClassOne?, val dataTwo: dataClassTwo?
)
Is it possible to apply the alias to both fields so that the data will be deserialised to one or the other, or should I go back to using a separate class for each schema?dinomite
03/03/2022, 8:27 PMDariusz Kuc
03/03/2022, 11:49 PMgraphql-kotlin
phil-t
03/04/2022, 9:11 AM