quarkus: http: port: 8080configuration: value: name1: test1 name2: test2 name3: test3
@ConfigProperty(name = "configuration.value")Values value;
public class ValueConverter implements Converter<Values> {
@Override public Values convert(String value) {// Here there would be the actual code to convert to Map. return new Values(map); }}
name1: test1 name2: test2 name3: test3
Is this a Eclipse Microprofile issue? Is this a bug? Is this a feature request? :)Or, is there another/better way of doing this?
--Thanks for the help!
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/71939b4f-984f-4384-9df8-c958b95df19c%40googlegroups.com.
You can use org.eclipse.microprofile.config.Config#getPropertyNames and iterate them all.
The annoying thing with the map is that it would be harder for you to know which config converts to what.
@david, I guess this might be another use case for the ConfigAccessors idea.
Cheers,
Roberto
> On 27 Feb 2020, at 20:35, David Lloyd <david...@redhat.com> wrote:
>
> On Thu, Feb 27, 2020 at 1:54 PM Georgios Andrianakis
> <gand...@redhat.com> wrote:
>> On Thu, Feb 27, 2020 at 7:31 PM Filipe Castilho <ktul...@gmail.com> wrote:
>>> Is this a Eclipse Microprofile issue? Is this a bug? Is this a feature request? :)
>>> Or, is there another/better way of doing this?
>>
>> I believe this isn't possible in Eclipse Microprofile, but I could very well be wrong, so I will let others comment.
>
> That's correct. In MP config, one property can map to one value.
> Multiple properties cannot be merged by any means defined in the MP
> config spec.
>
> You're probably best off doing this programmatically in your case:
> iterate the available property names, matching the property names you
> are interested in, and manually adding them to a map. It'd be about
> 4-5 lines of code at most, I think.
> --
> - DML
>
> --
> You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to quark...@googlegroups.com.