Skip to content
New issue

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

type must be number, but is null #3956

Closed
2 tasks
tesla-cat opened this issue Feb 24, 2023 · 1 comment
Closed
2 tasks

type must be number, but is null #3956

tesla-cat opened this issue Feb 24, 2023 · 1 comment
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)

Comments

@tesla-cat
Copy link

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

@nlohmann nlohmann added solution: wontfix the issue will not be fixed (either it is impossible or deemed out of scope) and removed kind: bug labels Feb 24, 2023
@nlohmann
Copy link
Owner

nlohmann commented Mar 5, 2023

Duplicate of #3799.

@nlohmann nlohmann added the solution: duplicate the issue is a duplicate; refer to the linked issue instead label Mar 5, 2023
@nlohmann nlohmann closed this as completed Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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)
Projects
None yet
Development

No branches or pull requests

2 participants