Description
openedon May 16, 2017
As it stands argument converters need to be applied (with @ConvertWith
) either to a custom annotation (at least it looks like that; couldn't make it work) or to the argument. When the former is not an option (for example because you can't make it work 😉), the latter quickly becomes repetitive.
An extension point that allows registering argument converters as the class and method level (much like parameter resolvers) would remedy this problem.
Beyond ease of use, this extension point would also enable creating more wholesome extensions which, applied to a test class, can register parameter resolvers, argument converters, post instance extensions, and more all in one annotation. It would also make it possible to do something like @ConvertByCalling("fromString")
(either on class, method, or parameter), which would try to call a static method fromString(String)
on the target type.
If you think this is a valuable feature, I'd like to take a shot at implementing it.