-
-
Notifications
You must be signed in to change notification settings - Fork 191
Description
I have a what I believe is a valid query, as it works on all the online playgrounds I have tried, and also works with the Python implementation of JMESPath. The query is as follows:
to_array("gw:GWallInfo"."gw:DocumentStatistics"."gw:ContentGroups"."gw:ContentGroup" || "gw:DocumentStatistics"."gw:ContentGroups"."gw:ContentGroup")[]."gw:IssueItems"."gw:IssueItem" | []
I would expect this query to work fine but it instead results in an assertions being triggered and preventing normal usage.
Minimal Code Example:
#include "jsoncons/basic_json.hpp"
#include "jsoncons_ext/jmespath/jmespath.hpp"
int main(int argc, char* argv[])
{
auto json = jsoncons::json::parse("{}");
auto result = jsoncons::jmespath::search(json,
"to_array(\"gw:GWallInfo\".\"gw:DocumentStatistics\".\"gw:ContentGroups\".\"gw:ContentGroup\" || "
"\"gw:DocumentStatistics\".\"gw:ContentGroups\".\"gw:ContentGroup\")[].\"gw:IssueItems\".\"gw:IssueItem\" | []");
return 0;
}The exception is thrown on line 2642 of jmespath.hpp, which for me reads: JSONCONS_ASSERT(stack.size() >= 2); - it is inside the token_kind::binary_operator section.
What compiler, architecture, and operating system?
- Compiler: MSVC Visual Studio 2022
- Architecture (e.g. x86, x64) x64
- Operating system: Windows 11
What jsoncons library version?
- Latest release 1.3.0
- Other release ______
- master
If relevant, using the VCPKG version.