Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javadoc ignores constructor parameters of annotation class #4068

Open
ckalan opened this issue Mar 19, 2025 · 0 comments
Open

Javadoc ignores constructor parameters of annotation class #4068

ckalan opened this issue Mar 19, 2025 · 0 comments
Labels

Comments

@ckalan
Copy link

ckalan commented Mar 19, 2025

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

@ckalan ckalan added the bug label Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant