-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
JsonView::GetBool returns wrong value #1731
Comments
Hi @JanSiebert , |
The problem is still there till now.. |
This issue is still present in v1.11 |
Here is the fix: #2852 |
This is fixed with the linked PR. Please let me know if you have any other problems. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Confirm by changing [ ] to [x] below to ensure that it's a bug:
Describe the bug
Aws::Utils::Json::JsonView::GetBool
does not return the correct value if it has been set withAws::Utils::Json::JsonValue::WithBool
before. However, it works as expected if the value is serialized, deserialized and read afterwards.SDK version number
1.8.182
Platform/OS/Hardware/Device
What are you running the sdk on?
Linux 13a2faedf94d 5.11.0-25-generic #27-Ubuntu SMP Fri Jul 9 23:06:29 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
To Reproduce (observed behavior)
The following test case fails:
Expected behavior
I expected both test conditions to hold.
Additional context
While
valueint
indeed is set during parsing [1], it is not used to represent the value (i.e. it is not set when creating a boolean value [2]). cJSON offerscJSON_IsBool
,cJSON_IsFalse
andcJSON_IsTrue
. All these methods only look at thetype
field and not thevalueint
field.[1] https://github.com/aws/aws-sdk-cpp/blob/main/aws-cpp-sdk-core/source/external/cjson/cJSON.cpp#L1348
[2] https://github.com/aws/aws-sdk-cpp/blob/main/aws-cpp-sdk-core/source/external/cjson/cJSON.cpp#L2423
The text was updated successfully, but these errors were encountered: