summaryrefslogtreecommitdiffstats
path: root/yaml2json.py
diff options
context:
space:
mode:
authorJames Forsyth <jf2512@att.com>2019-08-13 19:34:31 +0000
committerGerrit Code Review <gerrit@onap.org>2019-08-13 19:34:31 +0000
commit1c153c5d59b3612d610429bd565ac63ba02e1bca (patch)
tree4776336c5eba85d577b37217466ccf168e1de806 /yaml2json.py
parent49dac227e84abe519693d6fc472c42c18570a79c (diff)
parentc44bcf608dc25c2047af65fbfdecba7dbce11e88 (diff)
Merge "AAI-2441 update swagger-format YAML generation"
Diffstat (limited to 'yaml2json.py')
-rw-r--r--yaml2json.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/yaml2json.py b/yaml2json.py
new file mode 100644
index 0000000..2aa315e
--- /dev/null
+++ b/yaml2json.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+# convert yaml to json
+# pip3 install pyyaml
+# http://pyyaml.org/wiki/PyYAMLDocumentation
+# py3 yaml2json.py < ~/code/manpow/homeland/heartland/puphpet/config.yaml
+# gist https://gist.github.com/noahcoad/51934724e0896184a2340217b383af73
+
+import yaml, json, sys
+sys.stdout.write(json.dumps(yaml.load(sys.stdin), sort_keys=True, indent=2))
+