simdjson-java
simdjson-java copied to clipboard
Handle null values while parsing double and float
When you try to parse JSON that has field with type (for ex.) double and value of that field is null, then it throws and exception. That PR will allow such value for Double and Float, since they have value NaN that fits for that purpose.
Thanks for the PR. A couple of comments:
- It would be good to add a test for this.
- I'm not sure why the parser should return
NaNin this case. If a field is defined asfloat(notFloat), and the JSON containsnullfor that field, it seems like an error that shouldn't be hidden.