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 x-kubernetes-preserve-unknown-fields mistakenly added to parent object #134

Merged
merged 2 commits into from
May 2, 2024

Conversation

euberseder-hubspot
Copy link

It seems that x-kubernetes-preserve-unknown-fields was pulled up to the parent object when a containing property was annotated with @JsonAnyX, which is correct behavior. The same property-level indicators were reused when @PreserveUnknownFields was added as an annotation, which means that any field annotated with that annotation will contain x-kubernetes-preserve-unknown-fields as will the parent, which isn't correct behavior.

This PR disambiguates the two cases, preserving the original behavior for the @JsonAny annotations but breaking the parent x-kubernetes-preserve-unknown-fields marking if @PreserveUnknownField is used. I've added a test which fails with the original code, but passes after the additions to AbstractJsonSchema.

@euberseder-hubspot euberseder-hubspot merged commit 9f666a9 into 5.12.2-hubspot May 2, 2024
2 of 8 checks passed
@euberseder-hubspot euberseder-hubspot deleted the preserve-unknown-fields-fix branch May 2, 2024 14:00
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.

2 participants