Error in trying to implement HOCON Config Source for Quarkus

97 views
Skip to first unread message

nweikeo...@gmail.com

unread,
Jun 9, 2021, 1:06:18 PM6/9/21
to Quarkus Development mailing list
Hello,
I am trying to configure my Quarkus application to use HOCON file format for its ConfigSource implementation .

Here are the steps that i took:

1) Add below in my pom.xml:
<dependency> <groupId>io.smallrye.config</groupId> <artifactId>smallrye-config-source-hocon</artifactId> <version>1.10.0</version> </dependency>

2) created a file with with the following content  and saved it in META-INF/microprofile-config.conf

{
"accepted.counties":
[
{"name": "Fiji", "code": "FJ"},
{"name": "Finland", "code": "FI"},
{"name": "France", "code": "FR"},
{"name": "French Guiana", "code": "GF"},
{"name": "French Polynesia", "code": "PF"},
{"name": "French Southern Territories", "code": "TF"},
{"name": "Gabon", "code": "GA"},
{"name": "Gambia", "code": "GM"}
]}

 I am getting com.typesafe.config.ConfigException$WrongType, "accepted.counties" has type LIST rather than STRING 

What step I am getting wrong?

Kind Regards,
Nweike

Roberto Cortez

unread,
Jun 9, 2021, 7:46:34 PM6/9/21
to nweikeo...@gmail.com, Quarkus Development mailing list
Hi Nweike,

Thanks for the report. Please feel free to open an issue in SR Config: https://github.com/smallrye/smallrye-config/ and I’ll have a look.

Cheers,
Roberto

--
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/e479b99c-0d5c-47c9-be99-f4a32322a5f5n%40googlegroups.com.

Nweike Onwuyali

unread,
Jun 10, 2021, 3:17:02 AM6/10/21
to Roberto Cortez, Quarkus Development mailing list
Hi Roberto,
I will do so, but just before I proceed the smallrye was not so clear where the HOCON file should be saved in in what format.

I saved it in  META-INF/microprofile-config.conf. Is that correct?

Kind Regards,
Nweike

Roberto Cortez

unread,
Jun 10, 2021, 2:46:04 PM6/10/21
to nweikeo...@gmail.com, Quarkus Development mailing list
Hi Nweike,

Thanks! Yes, the file location is correct. I’ll try to have a look into the issue in the next few days.

Cheers,
Roberto

Jordi Sola Alaball

unread,
Jun 14, 2021, 7:46:22 AM6/14/21
to radc...@yahoo.com, nweikeo...@gmail.com, Quarkus Development mailing list
Just to confirm:
Is `accepted.counties` correct, instead of `accepted.countries` (missing `r`)?

Jordi Sola

Contents Services Architect

Red Hat EMEA

jord...@redhat.com    
M: +34-699-679-776    



Roberto Cortez

unread,
Jun 14, 2021, 1:52:28 PM6/14/21
to Jordi Sola Alaball, nweikeo...@gmail.com, Quarkus Development mailing list
The source is reading all configs as plain Strings:

So I need to fix that. Let me have a look.

Reply all
Reply to author
Forward
0 new messages