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 for class attribute ignored when in EntityModel #2320

Closed
silviagreen opened this issue Jul 24, 2023 · 0 comments
Closed

javadoc for class attribute ignored when in EntityModel #2320

silviagreen opened this issue Jul 24, 2023 · 0 comments

Comments

@silviagreen
Copy link

silviagreen commented Jul 24, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant