Is it possible to configure the JSON representation in Jersey to
generate object lists instead of arrays like in this example? (found
[here][1])
{
"accomodations" : [
{
"accomodation" : {
"name": "...",
"category": "couch",
"uri": "
http://example.org/accomodations/accomodation_1"
}
},
{
"accomodation": {
"name": "...",
"category": "room",
"uri": "
http://example.org/accomodations/accomodation_2"
}
}
]
}
If I try using a `List<Accomodation>`, the result looks like
{
"accomodations" : [
{
"name": "...",
"category": "couch",
"uri": "
http://example.org/accomodations/accomodation_1"
},
{
"name": "...",
"category": "room",
"uri": "
http://example.org/accomodations/accomodation_2"
}
]
}
[1]:
http://stackoverflow.com/questions/2737809/restful-api-how-to-model-json-representation/2739537#2739537
Regards
Michael Justin