Enable CreatorTest and drop the stale @JsonCreator limitation - #170
Open
davidpavlovschi wants to merge 1 commit into
Open
Enable CreatorTest and drop the stale @JsonCreator limitation#170davidpavlovschi wants to merge 1 commit into
davidpavlovschi wants to merge 1 commit into
Conversation
CreatorTest has been disabled since 2018 with the message "JsonNullable in a constructor is deserialized to JsonNullable[null] instead of JsonNullable.undefined". That symptom is fixed today by the getAbsentValue override added in 3cc3de9 (2022, OpenAPITools#30). Nobody re-enabled the test, and README kept advertising the limitation. With @disabled removed, the existing test method passes against both the Jackson 2 and the Jackson 3 processor. Deleting the getAbsentValue override from one deserializer makes that processor's two cases fail with exactly the symptom the @disabled message described, so the test guards something rather than passing vacuously. Also adds a case covering explicit null versus absent, and corrects the comment about the @JsonProperty annotations: they are required, because parameter names are not retained by default. README drops the now-false @JsonCreator bullet and documents the behaviour instead. The @JsonUnwrapped limitation stays, since JsonNullableUnwrappedTest still fails when enabled. No production code changes.
davidpavlovschi
force-pushed
the
enable-creator-test
branch
from
July 30, 2026 19:28
406f285 to
c222afb
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.
Summary
CreatorTest; thegetAbsentValue()overrides added after the test was disabled now preserveJsonNullable.undefined()for absent creator properties.nullfrom an absent sibling property.@JsonCreatorlimitation from the README and document the supported behavior.This changes tests and documentation only; it does not change production code.
Verification
I ran:
On JDK 25, the build completed successfully with 320 tests, 0 failures, 0 errors, and 3 expected
@JsonUnwrappedskips. All three Maven Invoker integration builds passed.The implementation session also performed a mutation check: removing either Jackson processor's
getAbsentValue()override makes that processor's creator cases fail with the original symptom (JsonNullable[null]instead ofJsonNullable.undefined()).CI supplies the JDK 17 check that I could not reproduce locally.
AI disclosure
Claude Opus 5 implemented and tested this change. OpenAI Codex independently reviewed the diff and reran the full build. David authorized this automated contribution workflow and owns the submission. The commit keeps an explicit
Co-Authored-Bytrailer for Claude.Summary by cubic
Re-enabled
CreatorTestand added a test to ensure absent@JsonCreatorparameters deserialize asJsonNullable.undefined(), distinct from explicit nulls. Updated README to remove the stale@JsonCreatorlimitation and document the supported behavior; tests/docs only, no production code changes.Written for commit c222afb. Summary will update on new commits.