Repository navigation
Fixed Nullability check for regular classes - #6
Merged
Merged
Conversation
If your message is a class instead of a record, adding a required field didn't fail the compatibility check. Now it does. Plus: failure messages now say which field or value broke, instead of just "Deserialization as X failed".
oskardudycz
force-pushed
the
fixed_nullability_check
branch
from
September 13, 2026 10:43
b1b3c34 to
1b4aab6
Compare
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.
If your message is a class instead of a record, adding a required field didn't fail the compatibility check. Now it does.
Plus: failure messages now say which field or value broke, instead of just "Deserialization as X failed".
Compatibility checks apply two rules:
So for the stored event in JSON:
{ "orderId": "00000000-0000-0000-0000-000000000001" }And reader class:
thenBackwardCompatible()check passed, leaving currencynull. It now fails with:Required field 'currency' in OrderPlaced is null after deserialization.Failure messages were also identical for every cause. A strict reader meeting an unknown field and a reader meeting an unknown enum value both reported Deserialization as OrderPlaced failed. The message now carries the cause, so it names missing properties.
Internal assertion
assertRequiredFieldsSatisfiedused for those checks returned early for anything that wasn't a record, so a class that added a required field passed.