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
Cannot unflatten json object #4349
Labels
solution: invalid
the issue is not related to the library
Comments
Your JSON value does not satisfy the requirements for unflatten, see https://json.nlohmann.me/api/basic_json/unflatten/ |
nlohmann
added
solution: invalid
the issue is not related to the library
and removed
kind: bug
labels
Apr 15, 2024
The flattened version of your JSON value would be {
"/SettingsRequest/ApplicationError/0": "1",
"/SettingsRequest/ApplicationError/1": "No ACK",
"/SettingsRequest/ApplicationError/2": "2",
"/SettingsRequest/ApplicationError/3": "No ACK",
"/SettingsRequest/ApplicationError/4": "3",
"/SettingsRequest/ApplicationError/5": "No ACK",
"/SettingsRequest/ApplicationError/6": "4",
"/SettingsRequest/ApplicationError/7": "No ACK",
"/SettingsRequest/DateAppliedOnDevice": "2024-04-15T09:29:25Z",
"/SettingsRequest/DateToExecuteOnDevice": "2022-08-04T17:01:39.645090001Z",
"/SettingsRequest/DeviceId": "12345",
"/SettingsRequest/SettingsPayloadId": 34,
"/SettingsRequest/SettingsValues": null
} With this value, {
"SettingsRequest": {
"ApplicationError": [
"1",
"No ACK",
"2",
"No ACK",
"3",
"No ACK",
"4",
"No ACK"
],
"DateAppliedOnDevice": "2024-04-15T09:29:25Z",
"DateToExecuteOnDevice": "2022-08-04T17:01:39.645090001Z",
"DeviceId": "12345",
"SettingsPayloadId": 34,
"SettingsValues": null
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I have a flattened object that I then want to unflatten but get the following error instead:
libc++abi: terminating with uncaught exception of type nlohmann::json_abi_v3_11_3::detail::type_error: [json.exception.type_error.315] values in object must be primitive
Reproduction steps
call unflatten() on a flatten json object.
Expected vs. actual results
Minimal code example
No response
Error messages
No response
Compiler and operating system
clang 13, linux
Library version
3.11.3
Validation
develop
branch is used.The text was updated successfully, but these errors were encountered: