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

Annotation @JsonUnwrapped generates empty field #2811

Open
Murasj opened this issue Dec 12, 2024 · 0 comments
Open

Annotation @JsonUnwrapped generates empty field #2811

Murasj opened this issue Dec 12, 2024 · 0 comments

Comments

@Murasj
Copy link

Murasj commented Dec 12, 2024

Hi,
this bug was noticed since 2.6.0 and still exists in 2.7.0 and block update SpringBoot in my app to version 3.4.0. Problem is that I have classes like below:

@Data
public class PreferenceData {

    @Schema(
        description = "Title",
        example = "My Title"
    )
    @NotBlank
    private String title;

    @NotNull
    @Valid
    private PreferenceConfigData config;
....
@Data
public class PreferenceConfigData {

    @JsonUnwrapped
    private PreferenceConfigSection preferenceConfigSection;

}
@Data
public class PreferenceConfigSection {
//some @NotNull and @NotBlank fields
}

Finally in generated json field config is empty, it doesn't contain any fields from DashboardConfigSection.
I've tried some suggestions like
SpringDocUtils.getConfig().addParentType
or disabling springdoc.model-converters.polymorphic-converter.enabled but any of it resolve my issue.

@Murasj Murasj changed the title Annotation JsonUnwrapper generates empty field Annotation @JsonUnwrapped generates empty field Dec 12, 2024
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