it seems most json APIs expect the type to be know...
# serialization
k
it seems most json APIs expect the type to be known in order to read the value
p
Have not done exactly this, but you may be able to do what you need by decoding to a JsonObject. This will give you a Map<String, JsonElement> . Unfortunately there is not an easy way to get the type, but you may be able to use JsonElement.primitive.booleanOrNull , floatOrNull, etc to find the type. will your payload have nested objects?
k
no, but it can have nested arrays
i saw JsonElement and it's subclasses. seems it uses a string representation internally
hmm, I might be able to make this work
got this working, thanks for the idea
p
Great!
j
protip: deserialize a Map