-
-
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
Conversion from alt_json to json produces incorrect result #3425
Labels
Comments
falbrechtskirchinger
added a commit
to falbrechtskirchinger/json
that referenced
this issue
Apr 12, 2022
A unit test in unit-alt_string.cpp converts a json object to an alt_json object. During the json_pointer refactor this failed to compile and was commented out. The failure can no longer be reproduced with the current code. This commit restores the test to its originally proposed form. Closes nlohmann#3425.
falbrechtskirchinger
changed the title
Conversion from alt_json to json fails to compile
Conversion from alt_json to json produces incorrect result
Apr 15, 2022
2 tasks
This was referenced May 27, 2022
falbrechtskirchinger
added a commit
to falbrechtskirchinger/json
that referenced
this issue
Jun 3, 2022
Add wrapper types to encode conversion target value types and to_json overloads to perform the conversions. Fixes nlohmann#3425.
falbrechtskirchinger
added a commit
to falbrechtskirchinger/json
that referenced
this issue
Jun 4, 2022
Add wrapper types to encode conversion target value types and to_json overloads to perform the conversions. Fixes nlohmann#3425.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A proposed unit test for
unit-alt-string.cpp
contained the following code:This conversion compiles but fails to produce the expected result. Instead, the resulting object is in fact the following array:
The test can be further reduced to this:
Resulting in:
The cause is the incorrect selection of this
to_json()
function forCompatibleArrayType = std::map<...>
.I suspect an error in
is_constructible_object_type
and will investigate.The requirements placed on
object_t
,string_t
, etc. should be clearly documented. Maybe a trait likeis_sax
would help?The text was updated successfully, but these errors were encountered: