quarkusio / quarkus-quickstarts

Quarkus quickstart code
https://quarkus.io
Apache License 2.0
1.92k stars 1.43k forks source link

ConfigMappings with single List of objects can't be processed #1396

Closed JoergStrebel closed 3 months ago

JoergStrebel commented 3 months ago

Hallo! I believe that I found a bug.

Quarkus: 3.8.2 Java: JDK 21 Maven: 3.9.6 GraalVM: - only JVM execution.

How to reproduce it: I tested the usage of yaml configuration files with Quarkus 3.8.2 based on the source code in https://github.com/quarkusio/quarkus-quickstarts/tree/main/config-quickstart and https://quarkus.io/guides/config-yaml. I am using the following application.yaml:

greeting:
  message: Hallo
  name: Jörg
country:
  - codes:
      - "cn"
      - "cn_vg"
    types:
      - CAR
  - codes:
      - "ab"
      - "cd"
    types:
      - MOTORCYCLE

I am using a @ConfigMapping(prefix="country").

What I am seeing: If I run the program, quarkus cannot be started and emits an error message that the confguration in the application.yaml has no root. The symptoms are the same as in https://github.com/smallrye/smallrye-config/issues/517

What I am expecting to see: I would expect Quarkus to process the configuration and place the list below the "country" key into a Java List of interface type CountryConfiguration (which I will provide)

Could you please check whether a ConfigMapping with a single List of objects can be processed in Quarkus?

gsmet commented 3 months ago

Closing as we already have: https://github.com/quarkusio/quarkus/issues/39640