Hi, another question about deserialising with Jackson - is it possible to deserialise fields with unknown names?
Here is an example which is part of a response which I want to deserialise:
"types": {
"10003327": {
"typeNumber": 11,
"classNumber": 335,
"display": 0,
"max": "2000",
"name": "My type"
}
},
The number
10003327
could be different in each response. If I was to use the data classes below I think it would work only for this example, but in another response with a different number it wouldn’t work:
data class Response(
val types: NumberType
)
data class NumberType(
@JsonProperty("10003327") val typeField: Type
)
data class Type(
val typeNumber: Int,
val classNumber: Int,
val display: Int,
val max: String,
val name: String
)
Is there a way to deserialise this completely when you don’t know what the number of the field will be, maybe with another annotation?