Using Config Converter for converting Map values

In quarkus extension, I've a configuration like the following that is mapping properties to a Java map and I'm trying to convert Map values with a custom converter.

` @ConfigMapping(prefix = "my.prefix")

public interface MyConfig {

Map<String, Function> functions();

} `

This fails at build time with error:

java: java.lang.ClassCastException: class$ArrayType cannot be cast to class javax.lang.model.type.DeclaredType ($ArrayType is in module jdk.compiler of loader 'app'; javax.lang.model.type.DeclaredType is in module java.compiler of loader 'platform')

Is there a way I can achieve the desired behaviour?


  • Use the following definition instead:

    Map<String,  @WithConverter(FunctionConverter.class) Function> functions();