JSON to XML: one root element for top-level arrays, and keep empty and nested arrays
Los mantenedores suelen responder en 1 día
@anurag2787 ya está trabajando en esto.
Desde el 19/10/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 85/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- next.js, typescript
- Área
- tooling
Línea de trabajo
Empieza por toXML y su rama para arrays en lib/json-utils.ts y, después, revisa la prueba existente de toXML en lib/__tests__/json-utils.test.ts. Añade comprobaciones del texto de salida para arrays de nivel superior, vacíos y anidados, y para los casos de objetos sin cambios. La tarea estará completa cuando pasen todos los casos de aceptación enumerados y la salida de los objetos existentes siga igual.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The JSON formatter's XML conversion (toXML in lib/json-utils.ts) gives broken XML when the JSON is an array, and it drops data for empty and nested arrays:
| JSON | XML now |
|---|---|
[1,2] |
two <rootItem> elements and no root element, which isn't well-formed XML |
[] |
only the <?xml ...?> line, with no element at all |
{"a":[]} |
an empty <root>, so a is gone |
{"a":[[1,2],[3]]} |
three <aItemItem> siblings, so [1,2] and [3] can't be told apart |
Objects, and arrays inside objects, are fine today: {"users":[{"id":1},{"id":2}]} gives two <user> elements inside <root>, and that should stay as it is.
Where to look
lib/json-utils.ts:toXML(line 571) and the array branch ofrender(lines 579 to 584)lib/__tests__/json-utils.test.ts: only one test touchestoXMLtoday (line 100), so add adescribe("toXML")blockapp/(tools)/json-formatter/components/ConversionPanel.tsx(line 59) is where the tool calls it
Acceptance criteria
- A top-level array gives one
<root>element with the items inside, so[1,2]gives<root>with two<rootItem>children - An empty array gives an empty element:
[]gives<root/>, and{"a":[]}gives<a/>inside<root> - An array inside an array gets its own element, so
{"a":[[1,2],[3]]}gives two<aItem>elements, the first with two<aItemItem>children and the second with one - Output for objects, and for arrays of values or objects inside objects, doesn't change
- Tests check the output text for each case above (please don't add an XML parser as a dependency)
-
npm run lint,npm run testandnpm run buildpass
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off develop, and open your PR against develop with Closes #204 in the description.
- Lenguaje dominante
- TypeScript
- Estrellas
- 1
- Forks
- 9
- Merge medio
- 10 h 24 min
- PR fusionados (30 d)
- 93
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de codercops/toolbelt
-
bug good first issue hacktoberfest
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día
-
bug good first issue hacktoberfest
Dificultad 2/5 1-3 horas Aptitud para principiantes 94/100
Los mantenedores suelen responder en 1 día
-
bug good first issue hacktoberfest
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
Los mantenedores suelen responder en 1 día
-
Stop the JSON formatter's Find bar from typing into the JSONPosiblemente ocupada @kudala-bharani la tomó hace 2 días. Abiertobug hacktoberfest help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
codercops/toolbelt#121 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
JSON formatter: a duplicate key crashes the whole toolPosiblemente ocupada @lb1192176991-lab la tomó hoy. Abiertobug good first issue hacktoberfest
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
codercops/toolbelt#218 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de codercops/toolbelt
Issues similares
-
skillopt: success-reflect prompt omits the edit schema, so every success-only edit is droppedAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Workspace secrets/constants containing "$" are corrupted when resolved in data source optionsAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
mobile-next/mobile-mcp#526 ·
Los mantenedores suelen responder en 1 día
-
e2e-failure ready-to-code
Dificultad 1/5 Menos de una hora Aptitud para principiantes 73/100
redhat-developer/rhdh-plugin-export-overlays#4470 · 1 comentario ·
Los mantenedores suelen responder en 1 día