Skip to content

javadoc for class attribute ignored when in EntityModel #2320

Closed
@silviagreen

Description

@silviagreen

I am working on a spring boot project where multiple Rest Controllers are exposed; I am using also hateoas, so each class is wrapped as EntityModel. In the project, lombok is also used to automatically generate all getters and setters.

Rest Controller documentation using javadoc is working correctly.
Class attributes, instead, are ignored only when the final result is wrapped as EntityModel.

To Reproduce

  • Create a class to use to create an entity, i.e. Account. Comment its attribute using javadoc.
  • Create a RestController, with at least one method returning a variable of type EntityModel
  • Run application and generate the documentation
  • The attributes of EntityModel have no description set.

image

Everything works fine if I use @Schema(description="...") instead of Javadoc.

  • What version of spring-boot you are using?

3.0.5

  • What modules and versions of springdoc-openapi are you using?

springdoc-openapi-starter-webmvc-api (v2.1.0)
therapi-runtime-javadoc-scribe (v0.15.0)

Expected behavior

Documentation of the return type attributes should contain the same content of their respective javadocs

Example

https://github.com/silviagreen/test-springdoc-bug

Screenshots
I tried to analyze the issue, and it seems that in class springdoc-openapi-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java

the method that should be called to get the javadoc content is never called because EntityModel.class.isRecord() = false.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions