springdoc / springdoc-openapi

Library for OpenAPI 3 with spring-boot

Home Page:https://springdoc.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve javadoc descriptions

benjamin3322 opened this issue · comments

Is your feature request related to a problem? Please describe.

When using the javadoc module to document APIs or Schemas, the generated output appears incorrect and confusing.

If the documentation contains javadoc tags, these tags are improperly included in the OpenAPI documentation.

Example:

public class MyClass {
    /**
     * This is a property description; this class extends {@link Object}.
     */
    private String myProperty;
}

In the OpenAPI output, the description for myProperty appears as: This is a property description; this class extends {@link Object Object}.

Note that the duplicate Object is not a typo.

Describe the solution you'd like

I expect the documentation to correctly escape all javadoc tags (for example, using backticks for code/link formatting).

Desired output: This is a property description; this class extends Object.

The SpringDocJavadocProvider should define a proper formatter that utilizes the OpenAPI specification's (like rich-text formatting).

Describe alternatives you've considered

None. Currently, the only workaround is to completely rewrite the SpringDocJavadocProvider implementation with a custom formatter.

Additional context

  • therapi-runtime-javadoc 0.15.0
  • springdoc-openapi 2.2.0

@benjamin3322,

There is no plan for such a feature.
Feel free to propose directly a PR, if you feel it useful for the community.