You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Exception when parsing nested JSON objects with the cursor API
Using the cursor API should not throw exception with valid JSON
When parsing a nested object with the cursor API the final cursor.check_done() throws an exception.
Enumerate the steps to reproduce the bug
Test-Program:
#include "jsoncons/json.hpp"
std::string_view jsondoc = R"({ "prop": { "nested": 123}})";
int main() {
auto _doc = jsoncons::json::parse(jsondoc); // this is ok
//
jsoncons::json_string_cursor cursor(jsondoc);
for (const auto& [_key, _value] :
jsoncons::staj_object<std::string_view, jsoncons::json>(cursor)) {
}
cursor.check_done(); // check_done() is not happy
// what(): Unexpected non-whitespace character after JSON text at line 1 and column 27
return 0;
}
What compiler, architecture, and operating system?
Compiler: gcc (GCC) 14.2.1 20250207
Architecture: x64
Operating system: Arch Linux
What jsoncons library version?
Latest release 1.3.1
Other release ______
master
The text was updated successfully, but these errors were encountered:
Thanks for raising this. It should be fixed on master. The issue was not with cursors per se, but rather with the implementation of iterators on staj_object_view. The issue was introduced in 1.3.1.
Describe the bug
Exception when parsing nested JSON objects with the cursor API
Using the cursor API should not throw exception with valid JSON
When parsing a nested object with the cursor API the final
cursor.check_done()
throws an exception.Enumerate the steps to reproduce the bug
Test-Program:
What compiler, architecture, and operating system?
What jsoncons library version?
The text was updated successfully, but these errors were encountered: