Hi,
today I updated the jsonstreamimporter to version 8.3.0 and now the parser is converting the string number "0" to a float 0.0.
I found a bug in the file ParserHelper.php on the line 50.
...
public static function convertToNumber(string $text)
{
// thanks to #andig for the fix for big integers
if (filter_var($text, FILTER_VALIDATE_INT) && (float) $text === (float) ((int) $text)) {
// natural number PHP_INT_MIN < $num < PHP_INT_MAX
return (int) $text;
}
// real number or natural number outside PHP_INT_MIN ... PHP_INT_MAX
return (float) $text;
}
The php function filter_var returns a 0 for filter_var($text, FILTER_VALIDATE_INT) if $text is "0", so that the if-condition evaluates to false.
It should be fixed to
...
if (filter_var($text, FILTER_VALIDATE_INT) !== false && (float) $text === (float) ((int) $text)) {
...
so that "0" will be correctly parsed to the integer 0.