Skip to content

Javadoc Descriptions Lost When Using @JsonProperty for Property Name Change in springdoc-openapi #2438

Closed
@wangxing-git

Description

@wangxing-git

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions