First of all, I agree that the question was a bit strange, but I can not write my question any other way. At the end of the explanation of the problem if someone wants to suggest a better title that expresses the problem better, I will be grateful.
Come on. Today I have a map
with values as follows:
HashMap<String, Pessoa> map = new HashMap<>();
map.put("max", pessoa1);
map.put("min", pessoa2);
I run the Gson
library and get the following json:
{
"min": {
"name": "Fulano",
"age": 10,
},
"max": {
"name": "Siclano",
"age": 13
}
}
But what I need is: (Note the brackets []
):
{
"min": [
"name": "Fulano",
"age": 10,
],
"max": [
"name": "Siclano",
"age": 13
]
}
What do I need to do to get json
with the brackets?
I saw this question in stack . You have relation to my problem.