I want to get the list of variable parameters in JSON format of a POST request to a Jersey/Dropwizard backend.
Consider the json body in a POST request
{
"tag1" : "tag1" ,
"parameter" :
[ "key1" : "value1",
"key2" : "value2" ]
}
Now the length of the parameters might vary so I was wondering how to access these key and values.
I tried the block
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response insertJob(
@PathParam("tag1") String tag1,
@PathParam("parameter") List<Result> parameters
) {
return Response.ok(resultList).build();
}
but I get I get the error
No injection source found for a parameter of type public javax.ws.rs.core.Response ....
I was wondering what injection I am missing. by the way I use guice as an dependency injector