summaryrefslogtreecommitdiffstats
path: root/python/codegen_python_client.sh
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-28 13:04:46 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-28 13:04:46 -0700
commitaf542d66d884bd17daa6f40f3556aa4189b23b36 (patch)
tree8b9ab8b62da97f547dea7caf8be3d52917e884de /python/codegen_python_client.sh
parent6918fced32c7cb8c351692b0fd5e87dd3ed734a2 (diff)
downloadfatcat-af542d66d884bd17daa6f40f3556aa4189b23b36.tar.gz
fatcat-af542d66d884bd17daa6f40f3556aa4189b23b36.zip
python client codegen
Diffstat (limited to 'python/codegen_python_client.sh')
-rwxr-xr-xpython/codegen_python_client.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/python/codegen_python_client.sh b/python/codegen_python_client.sh
new file mode 100755
index 00000000..1e56f4dd
--- /dev/null
+++ b/python/codegen_python_client.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -ex
+
+OUTPUT=`pwd`/codegen-out
+mkdir -p $OUTPUT
+cp ../rust/fatcat-openapi2.yml $OUTPUT/api.yml
+
+docker run \
+ -v $OUTPUT:/tmp/swagger/ \
+ swaggerapi/swagger-codegen-cli:v2.3.1 \
+ generate \
+ --lang python \
+ --input-spec /tmp/swagger/api.yml \
+ --output /tmp/swagger/ \
+ -DpackageName=fatcat_client
+
+sudo chown -R `whoami`:`whoami` $OUTPUT
+cp -r $OUTPUT/fatcat_client fatcat_client
+cp -r $OUTPUT/test tests/fatcat_client