Skip to content

Enable CreatorTest and drop the stale @JsonCreator limitation - #170

Open
davidpavlovschi wants to merge 1 commit into
OpenAPITools:masterfrom
davidpavlovschi:enable-creator-test
Open

Enable CreatorTest and drop the stale @JsonCreator limitation#170
davidpavlovschi wants to merge 1 commit into
OpenAPITools:masterfrom
davidpavlovschi:enable-creator-test

Conversation

@davidpavlovschi

@davidpavlovschi davidpavlovschi commented Jul 29, 2026

Copy link
Copy Markdown

Summary

  • Re-enable CreatorTest; the getAbsentValue() overrides added after the test was disabled now preserve JsonNullable.undefined() for absent creator properties.
  • Add a regression case that distinguishes an explicit JSON null from an absent sibling property.
  • Remove the stale @JsonCreator limitation from the README and document the supported behavior.

This changes tests and documentation only; it does not change production code.

Verification

I ran:

./mvnw -B clean verify -P integration-test

On JDK 25, the build completed successfully with 320 tests, 0 failures, 0 errors, and 3 expected @JsonUnwrapped skips. 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 of JsonNullable.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-By trailer for Claude.


Summary by cubic

Re-enabled CreatorTest and added a test to ensure absent @JsonCreator parameters deserialize as JsonNullable.undefined(), distinct from explicit nulls. Updated README to remove the stale @JsonCreator limitation and document the supported behavior; tests/docs only, no production code changes.

Written for commit c222afb. Summary will update on new commits.

Review in cubic

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

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.

1 participant