I have a custom StringToBooleanConverter
that should replace the default converter coming with Spring. So the source and target types are exactly the same. But instead of replacing the existing Spring converter, my converter is added. If I debug the application, I can see both converters in the same map entry of the Map
ConversionService#converters.
The ConversionService is configured like this:
@Bean
open fun conversionService(converters: Set<Converter<*, *>>) =
ConversionServiceFactoryBean().apply { setConverters(converters) }
@Bean
open fun stringToBooleanConverter() = MyStringToBooleanConverter()
// some more converters not relevant here ...
The problem is that sometimes the wrong converters gets used.
How can I remove/replace/hide/deactivate the converter delivered by Spring?