-
-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing of null
Integer fields changed behavior between version 2.11.4 and 2.12.X
#473
Comments
This is XML-specific, so will move ( |
I'll have to think about this for a bit -- change itself would not have been planned, but handling of "empty" values with XML is rather tricky as conceptually
is identical to
and in both cases logical textual content to process is empty String (""). Handling of that did change internally to allow dealing with this case for POJOs (to end up with "empty" Objects). But I can see how such values should ideally become either So I think that this change is a side effect of legitimate fixes for non-scalar types. |
Yea, I suspect since the intent is ambiguous from just looking at only the XML (does empty mean null? or 0? or ...?) there's no "right" answer, other than to be opinionated one way or the other (and consistent) with how it's handled. That said, it might be worth noting the change of behavior in the release notes. Thanks! :) |
@Crim fully agree wrt release notes for 2.12 at very least. I have an idea of how this might be relatively simple different wrt new-ish "coercion config" settings for XML module, but if so, how to change things 2.12 -> 2.13 (and if....) is the big question. |
null
Integer fields changed behavior between version 2.11.4 and 2.12.X
Actually I think I can fix the reported issue for 2.12.4; also created a related issue #474. |
Should be fixed for integer/floating-point wrapper types as well as |
thanks! |
Running version
2.11.4
using the following configuration:Parsing the following xml:
into the following bean:
usage:
The above JSON gets deserialized into the bean with the
cost
property being set tonull
.With version
2.12.x
thecost
property becomes integer0
I reviewed the release notes and didn't notice any breaking change listed in behavior. Is this change expected?
Thanks!
The text was updated successfully, but these errors were encountered: