I am currently developing a RESTful API and using JAX-RS for the backend. Many repons have the following simple form:
{
"someList": [
"item1" : ...,
"item2" : ...,
"itemn" : ...
]
}
The name of the array field is important. Required by client (EmberJS data). I am trying to create answers with a standard ResponseBuilder, but I do not know how to determine the field name for the list. All the answers I get are as follows:
[
"item1" : ...,
"item2" : ...,
"itemn" : ...
]
In the past, I always created a container class with one property for a list. It works, but I think there should be a better solution. Maybe a helper class for converting other objects?
source
share