Skip to content

Commit

Permalink
Merge pull request #546 from Uniplore-X/patch-1
Browse files Browse the repository at this point in the history
unexpected behavior for built-in function `join` of  jmespath
  • Loading branch information
danielaparker authored Oct 25, 2024
2 parents 5967982 + 1b54cae commit 5360845
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions include/jsoncons_ext/jmespath/jmespath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1001,17 +1001,24 @@ namespace jmespath {

string_type sep = arg0.template as<string_type>();
string_type buf;
for (auto& j : arg1.array_range())
bool is_first = true;
for (auto &j : arg1.array_range())
{
if (!j.is_string())
{
ec = jmespath_errc::invalid_type;
return resources.null_value();
}
if (!buf.empty())

if (is_first)
{
is_first = false;
}
else
{
buf.append(sep);
}

auto sv = j.template as<string_view_type>();
buf.append(sv.begin(), sv.end());
}
Expand Down

0 comments on commit 5360845

Please sign in to comment.