Public
Authored by Dan Thomson

Convert JSON to YAML

This is the simplest way I've found to make the conversion.

YAML is a superset of JSON, so all valid JSON should convert successfully to YAML.

This snipped requires jq which is likely provided as a package on your Linux distribution (eg. yum install jq). If you have Python installed, you can also pip install jq (or pip3 install jq if you want to use Python 3).

It also required yq (https://github.com/kislyuk/yq/) which is written to use jq. There probably isn't a package in your distribution for yq, but you can use pip or pip3 to install this tool.

Edited
json-to-yaml.sh 253 Bytes
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment