One thing I learned while writing this is how often YAML duplicate keys
silently break JSON conversion in CI pipelines.
Curious if others have run into similar issues.
JSON to XML should be easy but XML to JSON can not really be done 1 to 1 because of attributes. There is no clear way how to map them. You can establish a mapping for yourself but it will just be a convention on top of JSON.
Are LLMs too expensive, or not reliable enough at not making mistakes, or just something you haven't considered?
It's not something I generally need to do, so I haven't been keeping up with how good LLMs are at this sort of conversion, but seeing your question I was curious so I took a couple of examples from https://www.json.org/example.html and gave them to the default model in the ChatGPT app (GPT 5.2 - at least that's the default for my ChatGPT Plus account) and it seemed to get each of them right on the first attempt.
YAML is great for human-readable configuration, but many APIs and tools expect JSON.
I wrote this short guide to explain when YAML → JSON conversion is required,
common pitfalls (indentation, duplicate keys, anchors),
and how this shows up in real Kubernetes and API workflows.
The GitHub Pages article is intentionally minimal, but it’s not meant to be a generic LLM dump.
The examples come from real issues I’ve hit while working with Kubernetes manifests and CI pipelines —
especially duplicate keys, implicit type coercion, and indentation edge cases that silently break JSON conversion.
I’m actively expanding it with:
- concrete Kubernetes + API payload examples
- cases where YAML parses but produces invalid JSON
- notes on tooling differences (yq, js-yaml, browser-based parsers)
The online converter exists mainly as a reference implementation that runs fully client-side and exposes these edge cases clearly:
https://jsonviewertool.com/yaml-to-json
Happy to improve the guide based on feedback — appreciate the pushback.
One thing I learned while writing this is how often YAML duplicate keys silently break JSON conversion in CI pipelines. Curious if others have run into similar issues.
Have you tried:
If someone can write something to convert between json and xml ill bless your offspring.
JSON to XML should be easy but XML to JSON can not really be done 1 to 1 because of attributes. There is no clear way how to map them. You can establish a mapping for yourself but it will just be a convention on top of JSON.
https://git.screebo.net/cperrin/XMLJSONConverter
Courtesy of Junie/Claude
Are LLMs too expensive, or not reliable enough at not making mistakes, or just something you haven't considered?
It's not something I generally need to do, so I haven't been keeping up with how good LLMs are at this sort of conversion, but seeing your question I was curious so I took a couple of examples from https://www.json.org/example.html and gave them to the default model in the ChatGPT app (GPT 5.2 - at least that's the default for my ChatGPT Plus account) and it seemed to get each of them right on the first attempt.
YAML is great for human-readable configuration, but many APIs and tools expect JSON.
I wrote this short guide to explain when YAML → JSON conversion is required, common pitfalls (indentation, duplicate keys, anchors), and how this shows up in real Kubernetes and API workflows.
Feedback welcome.
Is there an actual guide? It seems you've mainly pasted something along the lines of a ChatGPT output to a Github Pages html.
Fair question.
The GitHub Pages article is intentionally minimal, but it’s not meant to be a generic LLM dump. The examples come from real issues I’ve hit while working with Kubernetes manifests and CI pipelines — especially duplicate keys, implicit type coercion, and indentation edge cases that silently break JSON conversion.
I’m actively expanding it with: - concrete Kubernetes + API payload examples - cases where YAML parses but produces invalid JSON - notes on tooling differences (yq, js-yaml, browser-based parsers)
The online converter exists mainly as a reference implementation that runs fully client-side and exposes these edge cases clearly: https://jsonviewertool.com/yaml-to-json
Happy to improve the guide based on feedback — appreciate the pushback.