fix: add mapBlankStringToNull option to JsonNullableModule - #126
fix: add mapBlankStringToNull option to JsonNullableModule#126krangerich wants to merge 1 commit into
Conversation
Blank strings for non-String fields were silently deserialized as undefined() instead of of(null), breaking PATCH semantics. Default remains false for backwards compatibility.
|
please resolve the merge conflicts when you've time |
|
I reviewed the approach and it looks solid to me:\n\n- behavior change is opt-in () so backward compatibility is preserved\n- String targets remain unaffected\n- tests cover the new module behavior and existing paths\n\nI think this is a good fix for PATCH semantics. Once merge conflicts are resolved/rebased on latest , this looks ready for final maintainer pass. |
|
Correction to my previous comment (formatting got mangled):
After merge conflicts are resolved against master, this looks ready for maintainer final pass. |
|
I read the diff. The design is the conservative one and several details are right that are easy to get wrong: the flag defaults to The blocker is bigger than the "resolve the merge conflicts" comment suggests, and I do not think it has been stated on this PR yet. The three files this PR patches no longer exist on master. #117 ("Implement Jackson3 support and maintain Jackson2 support", merged) renamed them and added a parallel set. Current
So this is not a textual conflict resolution, it is a port. Concretely, the rebase has to:
If step 1 or 3 is skipped for the Jackson 3 half, Two smaller points for the rebase:
Finally, note this competes directly with #152, which makes the same behaviour change unconditionally and is already rebased on the post-#117 layout. The opt-in approach here is the backward-compatible one and I would argue for it on the 0.2.x line, but a maintainer needs to pick one before either author spends more time. I did not run this branch's tests: it targets classes that no longer exist on master, so it cannot compile there. Everything above is from reading the diff against the current tree. |
Blank strings for non-String fields were silently deserialized as undefined() instead of of(null), breaking PATCH semantics. Default remains false for backwards compatibility.
Summary by cubic
Adds a module option to control how blank strings deserialize for non-String JsonNullable fields. When enabled, "" or " " become JsonNullable.of(null) instead of undefined, restoring correct PATCH semantics. Default stays false for backward compatibility.
New Features
Migration
Written for commit 67a328e. Summary will update on new commits.