You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ParamConverter implementation for the Java Optional<T> container which was introduced in Jersey 2.34 (and Jersey 3.0.1) doesn't support handling custom types.
With Optional<T> being a container similar to Collection<T> (and its derivates), I would expect it to support custom types for which a ParamConverterProvider and ParamConverter exist.
Unfortunately this is not the case. org.glassfish.jersey.internal.inject.ParamConverters.OptionalProvider only supports the other types defined in org.glassfish.jersey.internal.inject.ParamConverters.AggregatedProvider but not any other type of parameters for which a ParamConverterProvider and ParamConverter have been registered.
Here's an example (using the Jersey testing framework) with a custom ParamConverterProvider and ParamConverter for java.time.Instant:
The
ParamConverter
implementation for the JavaOptional<T>
container which was introduced in Jersey 2.34 (and Jersey 3.0.1) doesn't support handling custom types.With
Optional<T>
being a container similar toCollection<T>
(and its derivates), I would expect it to support custom types for which aParamConverterProvider
andParamConverter
exist.Unfortunately this is not the case.
org.glassfish.jersey.internal.inject.ParamConverters.OptionalProvider
only supports the other types defined inorg.glassfish.jersey.internal.inject.ParamConverters.AggregatedProvider
but not any other type of parameters for which aParamConverterProvider
andParamConverter
have been registered.Here's an example (using the Jersey testing framework) with a custom
ParamConverterProvider
andParamConverter
forjava.time.Instant
:Refs #4651
Refs #4690
Refs #4790
The text was updated successfully, but these errors were encountered: