quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.78k stars 2.68k forks source link

Enum values are not displayed in extension documentation #43307

Closed wilvdb closed 1 month ago

wilvdb commented 1 month ago

Describe the bug

Enumeration values for configuration are not present in the generated documentation (asciidoc).

Expected behavior

File greeting-extension.adoc should contain configuration properties as below : Configuration property Type Default
org.acme.style classico-classic, funky required

Actual behavior

File greeting-extension.adoc contains configuration properties as below (enumeration name is displayed instead of enum values) : Configuration property Type Default
org.acme.style Style required

How to Reproduce?

Sample project is available here : https://github.com/wilvdb/greeting-extension

  1. mvn package
  2. check file content of : greeting-extension/target/asciidoc/generated/config/greeting-extension.adoc

Output of uname -a or ver

MINGW64_NT-10.0-19045 MC213429 3.3.3-341.x86_64 2022-01-17 11:45 UTC x86_64 Msys

Output of java -version

openjdk version "21.0.3" 2024-04-16 LTS OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode, sharing)

Quarkus version or git rev

3.14.4

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.4 (dfbb324ad4a7c8fb0bf182e6d91b0ae20e3d2dd9) Maven home: C:\dev\apache-maven-3.9.4 Java version: 21.0.3, vendor: Eclipse Adoptium, runtime: C:\Program Files\Temurin Default locale: en_US, platform encoding: UTF-8 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Additional information

Generated model in runtime module contains the enumeration value:

configRoots:
- extension:
    groupId: "org.acme"
    artifactId: "greeting-extension"
    name: "Greeting Extension"
    nameSource: "EXTENSION_METADATA"
    detected: true
  prefix: "org.acme"
  topLevelPrefix: "org.acme"
  items:
  - !<io.quarkus.annotation.processor.documentation.config.model.ConfigProperty>
    enum: true
    sourceClass: "org.acme.greeting.extension.runtime.Config"
    sourceName: "style"
    path: "org.acme.style"
    type: "org.acme.greeting.extension.runtime.Config.Style"
    phase: "RUN_TIME"
    environmentVariable: "ORG_ACME_STYLE"
    typeDescription: "Style"
    converted: true
    enumAcceptedValues:
      qualifiedName: "org.acme.greeting.extension.runtime.Config.Style"
      values:
        CLASSICO_CLASSIC:
          configValue: "classico-classic"
        FUNKY:
          configValue: "funky"
  qualifiedNames:
  - "org.acme.greeting.extension.runtime.Config"
quarkus-bot[bot] commented 1 month ago

/cc @MichalMaler (documentation), @ebullient (documentation), @inoxx03 (documentation), @michelle-purcell (documentation), @rolfedh (documentation), @sheilamjones (documentation), @sunayna15 (documentation)

wilvdb commented 1 month ago

Is there something new regarding this issue ?

gsmet commented 1 month ago

I'll have a look.

gsmet commented 1 month ago

This was an oversight, sorry about this. It will be fixed by https://github.com/quarkusio/quarkus/pull/43633 .

In passing, I don't think you need the converter? The values should be handled the way you want by default (which is fortunate as the config generation doesn't take the converters into account).

gsmet commented 1 month ago

And thanks for the great reproducer, it was a great time saver :).