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 Descriptions Lost When Using @JsonProperty for Property Name Change in springdoc-openapi #2438

Closed
wangxing-git opened this issue Dec 1, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@wangxing-git
Copy link

Describe the bug

When using @JsonProperty to change the property name, the Javadoc description is lost in the OpenAPI documentation generated by springdoc-openapi.

To Reproduce
Steps to reproduce the behavior:

  • Spring Boot version: 3.2.0
  • springdoc-openapi version: 2.2.0
  • Actual and expected result using OpenAPI Description (yml or json): [Include actual and expected OpenAPI descriptions]
  • Sample code (TestController or similar) or Test that reproduces the problem:
@RestController
public class TestController {

    @PostMapping("/springdoc/test")
    public void test(@RequestBody TestRequest request){
    }

    @Data
    static class TestRequest {

        /**
         * aa
         */
        @JsonProperty("b")
        private String a;

    }
}

Expected behavior

The Javadoc descriptions for properties should be retained in the OpenAPI documentation even when using @JsonProperty to change property names.

Screenshots
If applicable, add screenshots to help explain the problem.

Additional context
Add any other context about the problem here.

@bnasslahsen
Copy link
Contributor

@wangxing-git,

This is a duplicate of #2315
I have implemented a fix for it.

@bnasslahsen bnasslahsen added the enhancement New feature or request label Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants