aboutsummaryrefslogtreecommitdiffstats
path: root/golang/regen.sh
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-10 19:56:41 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-10 19:56:41 -0700
commit71c6b0a4418511a6c0046742512066fc27e51b21 (patch)
treefd6e6ac97df646f2d72a83fe5148eb40f38a9cd2 /golang/regen.sh
parent353de263272d41f6d7c1becb481f787966a1aa4c (diff)
downloadfatcat-71c6b0a4418511a6c0046742512066fc27e51b21.tar.gz
fatcat-71c6b0a4418511a6c0046742512066fc27e51b21.zip
cleanup openapi schema
Diffstat (limited to 'golang/regen.sh')
-rwxr-xr-xgolang/regen.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/golang/regen.sh b/golang/regen.sh
new file mode 100755
index 00000000..366314a0
--- /dev/null
+++ b/golang/regen.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set -xeo pipefail
+
+cat fatcat-openapi2.yml | python3 -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' > fatcat-openapi2.json
+swagger generate server -A fatcat -f ./fatcat-openapi2.json --exclude-main -t gen
+rm fatcat-openapi2.json