Repository navigation
fix(java-dsl): When serialising error classes that have their own @JsonIgnoreProperties, still strip the throwable properties - #1473
Merged
TimothyJones merged 2 commits intoOct 6, 2026
Conversation
…internals, so that an exception's own class-level @JsonIgnoreProperties can no longer reintroduce its stack trace - Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…s, including that an exception's own ignored properties are added to them rather than replaced - Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
|
Nice one. For next time, you call out the breaking change in the commit message - the commit guidelines are in the contributing doc here: https://github.com/case-contract-testing/contract-case/blob/main/CONTRIBUTING.md |
@JsonIgnoreProperties, still strip the throwable properties
Merged
Member
|
Merged as a non-breaking change, following the guideline of fixes to unexpected behaviour bugs that are either documented or outside what a user would normally expect aren't breaking changes (also I'm pretty sure you're the only one using the error serialisation feature). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #1467
Problem
errorInternalsMapper()strips the standardThrowableproperties via a mixin registered onThrowable.class.Jackson resolves
@JsonIgnorePropertiesby most-specific-wins rather than by merging ignored sets, so a class-level annotation on the exception overrides the inherited mixin entirely.This results in the ignored
Throwableproperties being serialised again.Fix
Replace the mixin with a
JacksonAnnotationIntrospectorwhich, for anyThrowable, ignores the union of the class-specific@JsonIgnorePropertiesand our specifiedThrowableproperties when serialising.Notes
errorInternalsgetting support and this fix occurring anybody has hit this exact edge case and started matching on these properties, an upgrade will cause them to fail to verify.