Class FuzzyEnumParamConverterProvider

java.lang.Object
io.dropwizard.jersey.validation.FuzzyEnumParamConverterProvider
All Implemented Interfaces:
jakarta.ws.rs.ext.ParamConverterProvider

@Provider public class FuzzyEnumParamConverterProvider extends Object implements jakarta.ws.rs.ext.ParamConverterProvider
Provides converters to Jersey for enums used as resource parameters.

By default jersey will return a 404 if a resource parameter of an enum type cannot be converted. This class provides converters for all enum types used as resource parameters that provide better error handling. If an invalid value is provided for the parameter a 400 Bad Request is returned and the error message will include the parameter name and a list of valid values.

  • Constructor Details

    • FuzzyEnumParamConverterProvider

      public FuzzyEnumParamConverterProvider()
  • Method Details

    • getConverter

      public <T> @Nullable jakarta.ws.rs.ext.ParamConverter<T> getConverter(Class<T> rawType, @Nullable Type genericType, Annotation[] annotations)
      Specified by:
      getConverter in interface jakarta.ws.rs.ext.ParamConverterProvider