dropwizard validation issue not returning error in json format instead it is returning on html format in restful post method.

37 views
Skip to first unread message

Ram

unread,
Jun 14, 2020, 2:06:15 PM6/14/20
to dropwizard-user
Dear All,

1. I am using dropwizard version 0.6.2 , while applying @valid in my rest request it is not returning error response in json format instead it is returning error in html format though I have mentioned as below. I am wondering because when request process successfully it returns the success response in json format correctly.
@Post
@Path("/mypath")
@Consume(MediaType.APPLICATION_JSON)
@Produce(MediaType.APPLICATION_JSON
public Response createMsg(@Valid RestRequest request){ ......}

2. Is there any way where I get all the bad request errors on missing required fields in one go and it displays all the validation messages for respective fields one by one in new lines in response?

Best Regards,
Ram Shukla

Jochen Schalanda

unread,
Jun 15, 2020, 5:38:55 AM6/15/20
to dropwiz...@googlegroups.com
Hi,

Dropwizard 0.6.2 is in every sense of the word deprecated and unsupported.

Please try upgrading to Dropwizard 1.3.x (in maintenance mode) or even better, to Dropwizard 2.0.x.

Best regards,
Jochen
Reply all
Reply to author
Forward
0 new messages