Turning API Output Into a Manifest
By toolbelt maintainers ·
Updated
The dashboard gave you JSON and the cluster wants YAML. The conversion is mechanical, and the mistakes are predictable.
What is this tool?
JSON and YAML carry the same data model, so converting is mostly about layout. YAML is easier to review in a pull request because a one-line change shows as a one-line diff.
How it works
The JSON is parsed and re-printed with two-space indentation. Values that would be misinterpreted on re-read — `yes`, `on`, numeric-looking strings — are quoted automatically.
Example
{"spec":{"replicas":3,"enabled":true}}
becomes
spec:
replicas: 3
enabled: trueWhen to use it
Converting an API response into a Kubernetes object. Producing a Compose file from JSON config. Making a captured payload into a readable fixture.
Optimization Tips
Check quoting after conversion. If a value must stay a string and it looks like a boolean or number, it should be quoted. Copy the result into your editor before applying it, so indentation damage is visible.
Frequently Asked Questions
Is key order preserved?
Why are some strings quoted?
Can I go back the other way?
What about very large integers?
Related tools
- CSV to JSONConvert CSV data to a JSON array of objects. Automatically maps the first row to object keys, perfect for importing spreadsheet data into web applications or APIs.
- JSON to CSVConvert a JSON array into a clean CSV file. Extract unique keys to form the header row, perfect for exporting API data for analysis in Excel or Google Sheets.
- XML to JSONConvert XML documents to JSON objects. Bridge the gap between legacy SOAP APIs and modern frontend applications while preserving attributes and hierarchical data.
- JSON to XMLConvert JSON objects to valid XML markup. Automatically handle arrays, attributes, and special characters, making it easy to integrate with older enterprise systems.