dropwizard
dropwizard copied to clipboard
FuzzyEnumParamConverter does not allow some error responses to be remapped using exception mappers
If FuzzyEnumParamConverter
calls the fromStringMethod
but is unable to convert the string to an enum value, it will throw a WebApplicationException
constructed using a Response
parameter instead of constructed using a String
message. This will cause Jersey to return the Response
as-is, bypassing any exception mappers that may be set up. This prevents exception mappers from being used to return error messages in a consistent format if an invalid enum value is provided as a path parameter. FuzzyEnumParamConverter
should construct the WebApplicationException
using a String
message parameter instead of a Response
so that it can be remapped into a response by the exception mappers.
I'm planning on submitting a PR to fix this issue.