Click here to Skip to main content
14,925,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm using ObjectMapper to serialize an object containing a map so that the corresponding serialized json text have an array instead of the map.

- First, I have a problem with JsonTypeInfo. It is not serialized in the json text but it is when I don't use my custom serializer (map -> array)

- An other problem, is that I don't know how to write the custom deserializer to deserialize the array to map.

I have write an example project available here : GitHub - mike03081972/sortedmaptest[^]

Normal serializer/deserializer can be tested with : Tests.serializeDeserializeTest

Custom serializer can be tested with : Tests.customSerializeTest

What I have tried:

google search :
java - Deserialize JSON array to Map using Jackson - Stack Overflow[^]
...
Posted
Updated 18-Nov-17 21:08pm

1 solution

Solution found for the second point : write custom deserializer

But nothing found for the first problem regarding the JsonTypeInfo
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900