BTW my simple and hacky work-around is to have the web-service lie in the @Produces annotation that it produces JSON, yet have it produce a Response that specifically references text/csv.
On Wednesday, June 8, 2016 at 3:46:49 PM UTC-4, David Smiley wrote: > > I'm working on a web-service endpoint that produces text/csv. If the > client sends a parameter that fails to pass validation, I get a 500 error > back, content-type text/html. It doesn't include the validation details. > What I'd like to see is a 400 error with the details so the client can > know how to correct the parameters. I'm indifferent as to wether the error > response is HTML or JSON. FWIW I'm using DropWizard 1.0 rc2. > > A specific error that seems to be indicative of the problem is: > ! > org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: > MessageBodyWriter not found for media type=text/csv, type=class > io.dropwizard.jersey.validation.ValidationErrorMessage, genericType=class > io.dropwizard.jersey.validation.ValidationErrorMessage. > > I realize I could create a custom MessageBodyProvider, but I wonder if > there is a better way? Like somehow to tell DropWizard to ignore the > advertised media type and always process errors as JSON. > > Thanks in advance, > ~ David > -- You received this message because you are subscribed to the Google Groups "dropwizard-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
