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

consider adding a bool json::is_valid(std::string const&) non-member function #541

Closed
user1095108 opened this issue Mar 31, 2017 · 2 comments
Labels
solution: duplicate the issue is a duplicate; refer to the linked issue instead

Comments

@user1095108
Copy link

Consider this scenario. An arbitrary string is provided to an app. The string is supposed to contain valid json, but the app has no way of knowing this. It tries to parse the json with json::parse(), but exceptions are disabled. This means, if the json is not valid, std::abort() will be called and the app will abort and there is no way to prevent this from happening.

@user1095108
Copy link
Author

you may need to add other overloads also, lol. All the overloads that parse() has.

@nlohmann
Copy link
Owner

This is a duplicate of #458.

@nlohmann nlohmann added the solution: duplicate the issue is a duplicate; refer to the linked issue instead label Mar 31, 2017
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
Projects
None yet
Development

No branches or pull requests

2 participants