~ converts each operand with JUEL's string converter, which falls back to Object.toString() for maps. A Jinjava map renders as {g=v}; Jinja2 renders the Python dict repr {'g': 'v'}.
Affected: master df50b0d7. Releases 2.7.6, 2.8.3 and 2.8.4 behave the same.
Reproduction
Jinja2 renders {'g': 'v'}. Jinjava renders {g=v}.
Direct output agrees between the engines: {{ {'g':'v'} }} renders {'g': 'v'} in both. A list operand also agrees ([1, 2]), so the difference is specific to map stringification through the concat path.
Root cause
StringConcatOperator.apply converts both operands with converter.convert(o, String.class) (src/main/java/com/hubspot/jinjava/el/ext/StringConcatOperator.java). The converter has no Python-style representation for maps, so the map's toString() value is used.
~converts each operand with JUEL's string converter, which falls back toObject.toString()for maps. A Jinjava map renders as{g=v}; Jinja2 renders the Python dict repr{'g': 'v'}.Affected: master
df50b0d7. Releases 2.7.6, 2.8.3 and 2.8.4 behave the same.Reproduction
{{ {'g':'v'} ~ length }}Jinja2 renders
{'g': 'v'}. Jinjava renders{g=v}.Direct output agrees between the engines:
{{ {'g':'v'} }}renders{'g': 'v'}in both. A list operand also agrees ([1, 2]), so the difference is specific to map stringification through the concat path.Root cause
StringConcatOperator.applyconverts both operands withconverter.convert(o, String.class)(src/main/java/com/hubspot/jinjava/el/ext/StringConcatOperator.java). The converter has no Python-style representation for maps, so the map'stoString()value is used.