some json validation can't provide the detail violation path #364
-
Hi experts, source code: int main()
} output: Error count: 1 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The detail is in auto reporter = [&error_count](const jsonschema::validation_output& o)
{
++error_count;
std::cout << "validation error : " << o.instance_location() << ": " << o.message() << "\n";
for (auto& err : o.nested_errors())
{
std::cout << " " << err.instance_location() << ": " << err.message() << "\n";
}
}; your output will be
|
Beta Was this translation helpful? Give feedback.
The detail is in
nested_errors()
, if you change your reporter to thisyour output will be