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

fix: respect @JsonUnwrapped & @Schema on props not fields only #2894

Merged
merged 1 commit into from
Feb 8, 2025

Conversation

wingsofovnia
Copy link
Contributor

@wingsofovnia wingsofovnia commented Feb 8, 2025

Rather than introspecting only fields for @JsonUnwrapped and @Schema, this PR switches to analyzing class properties using Jackson's introspection API.

This fixes a regression introduced (supposedly) in v2.6.0, affecting codebases where @JsonUnwrapped is placed on getters instead of fields - a valid location per annotation's target and respected by Jackson. This change eliminates disparities between how Springdoc displays DTOs and how Jackson interprets them.

The test and expected JSON are copied from app224, with the only modification being the relocation of @JsonUnwrapped to the getter.

Fixes #2879

Verified

This commit was signed with the committer’s verified signature.
wingsofovnia Illia Ovchynnikov
@bnasslahsen bnasslahsen merged commit d9520c1 into springdoc:main Feb 8, 2025
1 check passed
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 this pull request may close these issues.

@JsonUnwrapped is still broken since 2.5
2 participants