-
Notifications
You must be signed in to change notification settings - Fork 107
allow extra members for converted structs #1056
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
allow extra members for converted structs #1056
Conversation
|
An automated preview of the documentation is available at https://1056.jsondocs.prtest.cppalliance.org/libs/json/doc/html/index.html |
|
|
0534d31 to
ae620ca
Compare
|
An automated preview of the documentation is available at https://1056.jsondocs.prtest.cppalliance.org/libs/json/doc/html/index.html |
|
|
ae620ca to
a86add9
Compare
|
An automated preview of the documentation is available at https://1056.jsondocs.prtest.cppalliance.org/libs/json/doc/html/index.html |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1056 +/- ##
===========================================
+ Coverage 93.40% 93.69% +0.29%
===========================================
Files 91 91
Lines 8658 9138 +480
===========================================
+ Hits 8087 8562 +475
- Misses 571 576 +5
... and 10 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
a86add9 to
4d76902
Compare
|
An automated preview of the documentation is available at https://1056.jsondocs.prtest.cppalliance.org/libs/json/doc/html/index.html |
|
|
11f8035 to
533a570
Compare
|
An automated preview of the documentation is available at https://1056.jsondocs.prtest.cppalliance.org/libs/json/doc/html/index.html |
1 similar comment
|
An automated preview of the documentation is available at https://1056.jsondocs.prtest.cppalliance.org/libs/json/doc/html/index.html |
|
|
|
An automated preview of the documentation is available at https://1056.jsondocs.prtest.cppalliance.org/libs/json/doc/html/index.html |
|
|
2b758cc to
7038f99
Compare
|
An automated preview of the documentation is available at https://1056.jsondocs.prtest.cppalliance.org/libs/json/doc/html/index.html |
|
|
7038f99 to
82ac926
Compare
|
An automated preview of the documentation is available at https://1056.jsondocs.prtest.cppalliance.org/libs/json/doc/html/index.html |
|
|
82ac926 to
7b16bf7
Compare
|
An automated preview of the documentation is available at https://1056.jsondocs.prtest.cppalliance.org/libs/json/doc/html/index.html |
|
|
| --array_depth_; | ||
|
|
||
| if( (array_depth_ + object_depth_) == 0 ) | ||
| return parent_->signal_end(ec); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@grisumbras I believe there's a bug in this code. Consider the following scenario:
struct X
{
int a;
float b;
std::string c;
};
BOOST_DESCRIBE_STRUCT(X, (), (a, b, c))
struct W
{
X x;
};
BOOST_DESCRIBE_STRUCT(W, (), (x))
// ...
const auto json = R"(
{
"x": {
"unknown": [],
"a": 1,
"b": 3.14,
"c": "hello"
}
})";
W w{};
std::error_code ec;
parse_into(w, json, ec);
BOOST_TEST( !ec ); // Ok.
BOOST_TEST( w.x.a == 1 ); // Error: w.x.a is 0
BOOST_TEST( w.x.b == 3.14f ); // Error: w.x.b is 0.0
BOOST_TEST( w.x.c == "hello" ); // Error: w.x.c is ""Changing this line to signal_value seems to fix the issue:
| return parent_->signal_end(ec); | |
| return parent_->signal_value(ec); |
Please confirm if that was intentional as I might be missing some other scenario. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.








Fix #991