// test code
client().resource("/todo").type(MediaType.APPLICATION_JSON_TYPE).delete(mytodo);
...but that has its own unhelpful exception (note no actual error listed):
com.yammer.dropwizard.validation.InvalidEntityException: The request entity had the following errors:
at com.yammer.dropwizard.jersey.JacksonMessageBodyProvider.validate(JacksonMessageBodyProvider.java:75)
at com.yammer.dropwizard.jersey.JacksonMessageBodyProvider.readFrom(JacksonMessageBodyProvider.java:61)
at com.sun.jersey.spi.container.ContainerRequest.getEntity(ContainerRequest.java:488)
at com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider$EntityInjectable.getValue(EntityParamDispatchProvider.java:123)
at com.sun.jersey.server.impl.inject.InjectableValuesProvider.getInjectableValues(InjectableValuesProvider.java:46)
When I debug that stack, I see that it hits line 54 of Validator:
if (o == null) {
errors.add("request entity required");
}
In this case, why is o (the value param that's passed into JacksonMessageBodyProvider) null, and why doesn't "request entity required" surface in the exception that's thrown? It seems a lot like JacksonMessageBodyProvider should be scooping up that error message:
if (classes != null) {
final ImmutableList<String> errors = validator.validate(value, classes);
if (!errors.isEmpty()) {
throw new InvalidEntityException("The request entity had the following errors:",
errors);
}
}
Thanks