Skip to content

2.6.0 of springdoc-openapi-starter-webmvc-ui seems to introduce a regression when using @JsonUnwrapped & @Delegate #2682

Closed
@NPE78

Description

@NPE78

Describe the bug

We are using models encapsulated with @JsonUnwrapped and @Delegate (from lombok) instead of using regular extends (favor composition over inheritance).

Before version 2.6.0 of springdoc-openapi-starter-webmvc-ui, we were using 2.5.0 (we're using renovatebot to ensure we're at the latest versions).

All the fields from the delegated model are missing.

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using?
    3.3.2

  • What modules and versions of springdoc-openapi are you using?
    springdoc-openapi-starter-webmvc-ui (the one which has been upgraded from 2.5.0 to 2.6.0)

  • What is the actual and the expected result using OpenAPI Description (yml or json)?
    Expected: it should use all the fields from the two objects
    Actual: only the fields from the parent object are in the openapi documentation

  • Provide with a sample code (HelloController) or Test that reproduces the problem

@Builder
@Jacksonized
public record AvailabilityDateRequest(LocalDate date,
                                      @JsonUnwrapped @Delegate AvailabilityRequest availabilityRequest) {

}
@Builder
@Jacksonized
public record AvailabilityRequest(List<String> data) {
}

Expected behavior

In this example, the generated documentation should contain date & data.
With 2.6.0, it contains only date

Screenshots
If applicable, add screenshots to help explain your problem.
N/A

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions