-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Error when serializing empty json: type must be string, but is object #740
Comments
What do you expect should be the value of |
OK, so it is a design goal to forbid it. I am not sure why but you probably have a good reason. |
The problem is that JSON itself allows string types. And when I then store string |
What you were trying to do is get the value of If you want the "same" value that you passed into |
Can I close this issue? |
The last line raises:
terminate called after throwing an instance of 'nlohmann::detail::type_error'
what(): [json.exception.type_error.302] type must be string, but is object
On the other hand
dump()
works fine.This appears on commit e2e0ecd867413b0489a339d32509ef649ff1af5a
Also on v2.1.1.
The text was updated successfully, but these errors were encountered: