Open heldev opened 7 years ago
This is expected behavior. By default, all JSON objects are deserialized to java.util.LinkedHashMap
.
You can try using
new TypeReference<List<Map<String, Map<String,String>>>>() {}
instead of
new TypeReference<List<Map<String, Object>>>() {}
(unfortunately your example will fail because val1
is not a map)
I understand that there is, probably, some technical limitation from the jackson side, but this issue automatically breaks #75 deserialize(serialize(o)) equals o
rule and gives a really hard time in some cases. Would it be possible to fix it ?
Would it be possible to fix it ?
Up to now I have no idea about how that issue should be fixed. Maybe tests will be produced without nested cases only...
Hi @ruslansennov, do you have any updates on this? @heldev did you find a solution?
@bduisenov, no, not really :-/
You might find this Stackoverflow answer useful.
Hi, It looks like that it's impossible right now to deserialize a JSON as vavr map tree, because only top level elements are deserialized as javaslang collections, deeper levels are java containers: