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

Introduce @JsonIgnoreUnknownKeys annotation #2874

Merged
merged 3 commits into from
Dec 9, 2024
Merged

Conversation

sandwwraith
Copy link
Member

for more fine-grained control over JsonBuilder.ignoreUnknownKeys setting.

Fixes #1420

Also improve error message and path handling when 'Unknown key' exception is thrown

Fixes #2869
Fixes #2637

for more fine-grained control over JsonBuilder.ignoreUnknownKeys setting.

Fixes #1420

Also improve error message and path handling when 'Unknown key' exception is thrown

Fixes #2869
Fixes #2637
@sandwwraith sandwwraith requested a review from fzhinkin December 6, 2024 14:15
* should be ignored instead of throwing [SerializationException].
*
* With this annotation, it is possible to allow unknown properties for annotated classes, while
* general [Json.decodeFromString] would still reject them for everything else.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps I'm exaggerating, but won't such a description give the user the impression that this annotation only works with decodeFromString, but not with decodeFromJsonElement or decodeFromStream?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about that. Maybe rephrase as general decoding methods, such as [Json.decodeFromString] and others?

@sandwwraith sandwwraith merged commit aee6336 into dev Dec 9, 2024
4 checks 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.

3 participants