openapi-processor / openapi-processor-spring

an OpenAPI 3.0 & 3.1 interface & model java code generator for Spring Boot
https://docs.openapiprocessor.io
Apache License 2.0
35 stars 9 forks source link

Javadoc generation for record components is broken #288

Open eekboom opened 1 week ago

eekboom commented 1 week ago

Currently, javadoc is generated like this:

/** Response Data with details of the user's application */
public record GetApplicationDetailsResponse(
    /** MIME-Typ of referenced schema */
    @Values(values = {"application/xml"}) @JsonProperty("mime_type") String mimeType,
) {}

IntelliJ IDEA marks the (intended) Javadoc of mimeType with a warning "Dangling Javadoc comment" - and I just learned that the IDE is correct. The standard Doclet does not generate documentation from that.

The generator should use @param tags at the class level:

/** 
 * Response Data with details of the users application
 * 
 * @param mimeType MIME-Typ of referenced schema
 */
public record GetApplicationDetailsResponse( ...
hauner commented 1 week ago

some more examples https://github.com/openjdk/valhalla/tree/lworld/test/langtools/jdk/javadoc/doclet/testRecordTypes/examples

Thanks for reporting :-)