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

@param javadoc for record classes (JEP 395) are not recognized #2131

Closed
averak opened this issue Mar 14, 2023 · 4 comments · Fixed by #2140
Closed

@param javadoc for record classes (JEP 395) are not recognized #2131

averak opened this issue Mar 14, 2023 · 4 comments · Fixed by #2140

Comments

@averak
Copy link

averak commented Mar 14, 2023

Describe the bug

  • I want to use java record classes (JEP 395) for schema.
  • I use therapi-runtime-javadoc for generate OAS3 description field, but @param javadoc is not recognized.
    • If I use normal class, @param javadoc is recognized, but record classes aren't recognized.

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using?
    • 3.0.1
  • What modules and versions of springdoc-openapi are you using?
    • org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2
    • org.springdoc:springdoc-openapi-starter-common:2.0.2
    • com.github.therapi:therapi-runtime-javadoc:0.15.0
    • com.github.therapi:therapi-runtime-javadoc-scribe:0.15.0
  • What is the actual and the expected result using OpenAPI Description (yml or json)?
    • json
  • Provide with a sample code (HelloController) or Test that reproduces the problem

The code below does not work as expected.

/**
 * User
 *
 * @param name name 
 */
public record User(@Schema(requiredMode = Schema.RequiredMode.REQUIRED) name) {}

The code below works as expected.

public class User {
    /**
     * name
     */
    @Schema(requiredMode = Schema.RequiredMode.REQUIRED)
    name;
}
uc4w6c added a commit to uc4w6c/springdoc-openapi that referenced this issue Mar 14, 2023
@uc4w6c
Copy link
Collaborator

uc4w6c commented Mar 14, 2023

Can I fix it?

@averak
Copy link
Author

averak commented Mar 14, 2023

@uc4w6c

Thanks for the fix!
I hope this patch will be merged.

@bnasslahsen
Copy link
Contributor

@averak,

Patch available in v2.0.4

@averak
Copy link
Author

averak commented Mar 15, 2023

@bnasslahsen

Thank you so much, You've been very helpful!

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

Successfully merging a pull request may close this issue.

3 participants