Hello all,

I couldn't find any documentation to reference to here, but from what I 
could check Dropwizard uses / registers a quite "permissive" JAX-RS 
parameter converter called "FuzzyEnumParamConverter" [1][2].

Basically it leads to values with different cases, spaces and/or dots to be 
accepted and "coerced" to a enum value. [3]

I would like to disable that behavior and use a stricter converter instead 
which only converts exact matches of a enum literal value.

>From what I could check FuzzyEnumParamConverter is hard codedly registered 
in DropwizardResourceConfig [4]. So the only way I could think of to 
achieve the behavior I want is to register yet another 
ParamConverterProvider, with a higher priority, with my custom 
implementation.

But before going that way, I would like to confirm, is there any other way 
to either completely disable FuzzyEnumParamConverter or somehow configure 
its behavior? 

I'm using Dropwizard version 2.0.13.

Thanks in advance.

[1]: 
https://javadoc.io/doc/io.dropwizard/dropwizard-jersey/2.0.13/io/dropwizard/jersey/validation/FuzzyEnumParamConverter.html
[2]: https://github.com/dropwizard/dropwizard/pull/1734
[3]: 
https://javadoc.io/doc/io.dropwizard/dropwizard-util/2.0.13/io/dropwizard/util/Enums.html
[4]: 
https://github.com/dropwizard/dropwizard/blob/v2.0.13/dropwizard-jersey/src/main/java/io/dropwizard/jersey/DropwizardResourceConfig.java#L83

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dropwizard-user/3d11f5d5-19e0-4307-904e-2466d93f420en%40googlegroups.com.

Reply via email to