Skip to content

fix: unwrap string-wrapped empty containers and double-quoted values#5

Merged
jamartif merged 1 commit intomainfrom
fix/json-empty-containers-double-quotes
Mar 20, 2026
Merged

fix: unwrap string-wrapped empty containers and double-quoted values#5
jamartif merged 1 commit intomainfrom
fix/json-empty-containers-double-quotes

Conversation

@jamartif
Copy link
Owner

Summary

  • "{ }" / "[ ]"{} / []: Grafana a veces almacena objetos/arrays vacíos como el string literal "{ }" en lugar de la estructura JSON {}. Ahora se desenvuelven correctamente.
  • ""valor"""valor": valores con doble-comilla exterior producidos por re-serialización en Grafana. El patrón requiere 4 comillas consecutivas, por lo que los strings vacíos legítimos "" no se ven afectados.

Ambos pases se añaden en grafanaDeepClean tras el paso unquoteJsonStringValues.

Test plan

  • Pegar "{ }" como valor en un JSON y ejecutar Fix JSON → debe producir {}
  • Pegar "[ ]" → debe producir []
  • Pegar ""MiValor"" → debe producir "MiValor"
  • Verificar que strings vacíos "" en arrays/objetos no se modifican

🤖 Generated with Claude Code

- "{ }" / "[ ]" → {} / [] (Grafana stores empty objects/arrays as strings)
- ""value"" → "value" (double outer quotes from re-serialisation)

Both passes added to grafanaDeepClean after the unquoteJsonStringValues step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jamartif jamartif merged commit a17cbd9 into main Mar 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant