type must be number, but is null #3956
Labels
solution: duplicate
the issue is a duplicate; refer to the linked issue instead
solution: wontfix
the issue will not be fixed (either it is impossible or deemed out of scope)
Description
my json data contains huge amount of NaNs, instead of parsing it into null and give me this error
type must be number, but is null
, why don't you just parse it into std::nan ?this will save users from so much trouble!!!
i know you wrote this https://json.nlohmann.me/features/types/number_handling/#nan-handling
but this is not user friendly, do i need to write
if(! json_data.is_null()){ float x = json_data;}
manually for every variable that is possibly NaN ?Reproduction steps
.
Expected vs. actual results
.
Minimal code example
No response
Error messages
No response
Compiler and operating system
.
Library version
.
Validation
develop
branch is used.The text was updated successfully, but these errors were encountered: