W
W
web_dev2018-04-27 09:46:24
Java
web_dev, 2018-04-27 09:46:24

Jackson annotation - to interpret an object as an array?

Hello,
such a situation, there is an array, but it is passed as an object. We are talking about an array where the painted time intervals in the days of the week and other information. But it is not passed as an array, but as an object.
Is there some kind of Json annotation that says that this object should be interpreted as an array.
Here is an example object.

"hotline": {
        "Monday": { "ranges": [], "closed": false, "wholeDay": false },
        "Tuesday": { "ranges": [], "closed": false, "wholeDay": false },
        ....
        ....
        }

If I accept hotline from Java side as just Object, then Jackson interprets all attributes for me as LinkedHashMap, and to get all the information, it turns out not a very beautiful piece of code ..
Any ideas, solutions? I want to say right away that changing the structure of an object on the client is already when there is no normal solution at all ..
Thank you!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question