Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

`~` stringifies maps with Java Map.toString() instead of Python dict repr

Abierto
#1,341 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
82/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java
Área
backend

Línea de trabajo

Start with src/main/java/com/hubspot/jinjava/el/ext/StringConcatOperator.java and trace the converter.convert calls used for concatenation. Reproduce the map case from the issue, then check the existing direct map and list rendering behavior. Done means ~ renders maps with the Python-style representation while the documented direct and list outputs remain unchanged.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

~ 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

{{ {'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.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.

Lenguaje dominante
Java
Estrellas
785
Forks
184
Merge medio
6 d 22 h
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de HubSpot/jinjava

Todos los issues de HubSpot/jinjava

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.