You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Blank strings should not be deserialized as JsonNullable.undefined() #125
Context: When a request object has a field like Integer, but an empty/blank string is given, then Jackson deserializes this value as null.
When deserializing the empty/blank string into something like Optional<Integer>, then this will result in a value of Optional.empty(), not null.
The behavior of JsonNullable is inconsistent here: When using JsonNullable<Integer>, an empty/blank string will be deserialized as JsonNullable.undefined() (=not provided in the request) instead of JsonNullable.of(null) (=provided, but a null value).
I think, the best behavior here should be, that empty/blank strings should be deserialized as JsonNullable.of(null), not JsonNullable.undefined()
With it, a blank string for a non-String target becomes JsonNullable.of(null) instead of undefined(). The default is unchanged on 0.2.x. Making it the default is kept as a possible change for a later major line (see the discussion on #152), so leaving this open for that.
Activity
addesses Blank strings should not be deserialized as JsonNullable.und…
Add mapBlankStringToNull option to JsonNullableModule and JsonNullabl…
Add mapBlankStringToNull option to JsonNullableModule and JsonNullabl…
Thorsrud22 commentedon Sep 23, 2026
Status update: #186 (carrying #126) adds an opt-in option for this and is merged for 0.2.12:
With it, a blank string for a non-
Stringtarget becomesJsonNullable.of(null)instead ofundefined(). The default is unchanged on 0.2.x. Making it the default is kept as a possible change for a later major line (see the discussion on #152), so leaving this open for that.