jinja: coerce input for string-specific filters (#21370)

This commit is contained in:
Sigbjørn Skjæret
2026-04-03 15:03:33 +02:00
committed by GitHub
parent 887535c33f
commit 1f34806c44
3 changed files with 41 additions and 16 deletions
+12
View File
@@ -523,6 +523,18 @@ static void test_filters(testing & t) {
"hello"
);
test_template(t, "upper array",
"{{ items|upper }}",
{{"items", json::array({"hello", "world"})}},
"['HELLO', 'WORLD']"
);
test_template(t, "upper dict",
"{{ items|upper }}",
{{"items", {{"hello", "world"}}}},
"{'HELLO': 'WORLD'}"
);
test_template(t, "capitalize",
"{{ 'heLlo World'|capitalize }}",
json::object(),