Skip to content

Javadoc ignores constructor parameters of annotation class #4068

Open
@ckalan

Description

@ckalan

Describe the bug
KDoc commnents on Kotlin annotation class properties are not shown in the resulting Javadoc. In Kotlin, annotation parameters are defined as primary constructor parameters so we tried using @param and `@property' as well as putting the comments on the properties themselves without success.

Generated Javadoc for the annotation class lists the properties under the Fields Summary section with empty descriptions.

The issue doesn't occur for the html generator and above code is properly documented in html format.

Here is the source code for one of our annotations: https://github.com/bivektor/lombokt/blob/main/lombokt-api/src/main/kotlin/lombokt/ToString.kt

Expected behaviour
Dokka should show KDoc comment put on the property declaration, or on the class with either @param or @property for the associated parameter in the javadoc. Ideally, javadoc should show annotation properties under Required Elements and Optional Elements sections as standard javadoc behavior but I believe showing them next to fields may be enough.

Screenshots

Image

To Reproduce
The project sources are here: https://github.com/bivektor/lombokt/blob/main/lombokt-api/

Dokka configuration
Dokka configuration is here: https://github.com/bivektor/lombokt/blob/main/buildSrc/src/main/kotlin/dokka-conventions.gradle.kts

Installation

  • Operating system: macOS
  • Build tool: Gradle v8.1
  • Dokka version: 2.0.0

Additional context
We tried with both V1 and V2 and the issue is the same.

I think a simple change in the class.corte file would fix this but I am not sure about the consequences in other types. In that file, property prefix is missing at this line:

<td class="colLast">{{ description|raw }}</td>

I think it should be property.description|raw. When I fix it and run all tests, I don't get any failure so I guess that's not on purpose

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions