I have a resource that takes a UUID as a HeaderParam
@POST
@Path("/inquiry")
@UnitOfWork
@Consumes(MediaType.APPLICATION_JSON)
public Response inquiry(@HeaderParam("someGUID") UUID someGUID) {
System.out.println("*** Here ***");
return Response.ok().build();
}
When I hit the end point with a valid UUID in the header I get an error like this:
0289-4a42-a757-80cc6e4eb0a5, origin_ip=127.0.0.1] - Error processing request. {"status":400,"code":10000,"message":"HTTP 400 Bad Request","link":null,"developerMessage":null,"errors":[]}
! com.fasterxml.jackson.core.JsonParseException: Unexpected character ('c' (code 99)): Expected space separating root-level values
! at [Source: 0c006839-404e-4273-990a-4a69d77d5b70; line: 1, column: 3]
If I take the Param in as a String I can convert it (in the method) to a UUID just fine with:
@POST
@Path("/inquiry")
@UnitOfWork
@Consumes(MediaType.APPLICATION_JSON)
public Response inquiry(@HeaderParam("someGUID") String someGUID) {
System.out.println(UUID.fromString(someGUID));
return Response.ok().build();
}
Any idea why it doesn't work as a UUID in the params?