simdjson-java icon indicating copy to clipboard operation
simdjson-java copied to clipboard

Handle null values while parsing double and float

Open Szczurowsky opened this issue 1 year ago • 1 comments

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.

Szczurowsky avatar Aug 30 '24 17:08 Szczurowsky

Thanks for the PR. A couple of comments:

  1. It would be good to add a test for this.
  2. I'm not sure why the parser should return NaN in this case. If a field is defined as float (not Float), and the JSON contains null for that field, it seems like an error that shouldn't be hidden.

piotrrzysko avatar Oct 20 '24 08:10 piotrrzysko