From c44bcf608dc25c2047af65fbfdecba7dbce11e88 Mon Sep 17 00:00:00 2001 From: Keong Lim Date: Fri, 19 Jul 2019 18:43:10 +1000 Subject: AAI-2441 update swagger-format YAML generation update swagger-format YAML generation so that conversion to JSON is cleaner, i.e. use n/a instead of null string in empty fields update tests to match new output with n/a values update generate-uml-snapshot.sh to also convert yaml to json add the generated json files Change-Id: Idd87ddae3c2d7490eb954ef69582edd8200f4df4 Issue-ID: AAI-2441 Signed-off-by: Keong Lim --- yaml2json.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 yaml2json.py (limited to 'yaml2json.py') 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)) + -- cgit 1.2.3-korg