I have made a service that returns an array of UserSettings objects:
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/")
public Response getBulkSettings(@QueryParam("fields") List<String> fields, @QueryParam("ids") List<String> ids) {
List<UserSettings> responseArr = mailerService.fetchSettings(ids,fields);
return Response.ok(responseArr).build();
}
When I make a GET request on the URL http://localhost:8181/settings?ids=123&fields=customData,user_id I get the following:
[
{
"id": 0,
"user_id": 123,
"customData": "testCustomDataFor123",
"deactivationDate": null
}
]
While what I want is :
[
{
"user_id": 123,
"customData": "testCustomDataFor123"
}
]