Skip to content

Documentation of enum values coming from dependency JARs #51653

@yrodiere

Description

@yrodiere

Description

Currently if you use enums in extension config mappings, the javadoc is extracted from each value of that enum and added as a tooltip in the extension's configuration reference. See for example

This is a very nice feature, but only works if the enum is in the extension source. Which is sometimes impractical, because the library we're integrating in the extension might already define its own enums, perhaps even with javadoc.

If we switch to an enum of our own like we do in #51629 , just for the purpose of documenting each value of the enum, we run the risk of the library changing the enum's values without us noticing (e.g. adding new values), and then the configuration is more limiting than it should be.

Implementation ideas

Could we either:

  1. Ideally, extract the library's enum javadoc and use that? That would likely be challenging.
  2. More realistically, provide a way to use the library's enums for configuration, while (somehow) adding documentation to each value? E.g. We could imagine an annotation to be put on the configuration method: @ConfigDocEnumValueDocs(value = "AUTO", docs = "This is some docs")? Or something less ugly :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions