smallrye-config icon indicating copy to clipboard operation
smallrye-config copied to clipboard

@ConvertWith in Map value type parameter is not working

Open radcortez opened this issue 3 years ago • 2 comments

Something like this should work:

@ConfigMapping(prefix = "map")
public interface MapOfList {
    Map<String, @WithConverter(ListConverter.class) List<String>> map();
}

But it got broken when the Collection support was added because now the Map value type is mapped as a CollectionProperty and does not take the Converter into account.

radcortez avatar Jan 12 '22 15:01 radcortez

Unfortunately, due to https://github.com/oracle/graal/issues/3671, the proposed solution does not work in native mode.

Also, there are some substitutions in Quarkus that also affect this: https://github.com/quarkusio/quarkus/blob/8bb206d35aff8cb3c9f7c72c9938685f3d6fb85d/core/runtime/src/main/java/io/quarkus/runtime/graal/MethodReplacement.java#L13 https://github.com/oracle/graal/issues/650

Most likely we can get rid of that, but not before a fix for https://github.com/oracle/graal/issues/3671.

radcortez avatar Jan 17 '22 17:01 radcortez

Just to give more context to casual observers, this started at https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/Config.20mapping.20a.20map.20of.20lists.

marcelstoer avatar Apr 29 '22 13:04 marcelstoer

I guess it's now time to revisit this as the Graal blocker was apparently fixed with 22.1.

marcelstoer avatar Nov 08 '22 15:11 marcelstoer

I'll have a look.

radcortez avatar Nov 09 '22 14:11 radcortez