We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I think there is some ambiguity in how the null numeric values are parsed. Or, at least, it would be nice to have a somehow configurable behaviour.
Here is the issue. I have this bean:
@PropertyDefinition(validate = "notNull") private final Double number;
When I parse the following jsons (which should represent the same content) I get two different results
{"number":null} --> number=Double.NaN {} --> number=null --> IllegalArgumentException("Argument number must not be null")
I expected to get the exception in both cases. What do you think?
I noticed that AbstractJsonReader leniently accepts null as NaN. Would it be possible to change this in your opinion?
The text was updated successfully, but these errors were encountered:
The normal way to write a primitive value is:
@PropertyDefinition private final double number;
JSON does not support NaN, so the parsing of null is intended to provide a backdoor way of passing NaN from something that strictly rejects NaN.
null
I'd be reluctant to change the behaviour as someone may be relying on it.
Sorry, something went wrong.
No branches or pull requests
I think there is some ambiguity in how the null numeric values are parsed. Or, at least, it would be nice to have a somehow configurable behaviour.
Here is the issue.
I have this bean:
When I parse the following jsons (which should represent the same content) I get two different results
I expected to get the exception in both cases.
What do you think?
I noticed that AbstractJsonReader leniently accepts null as NaN. Would it be possible to change this in your opinion?
The text was updated successfully, but these errors were encountered: