summaryrefslogtreecommitdiffstats
path: root/python/codegen_python_client.sh
blob: ba9bb3d398803ffb864a77850f62e4aa2ef650e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

set -exu
set -o pipefail

OUTPUT=`pwd`/codegen-out
mkdir -p $OUTPUT
cp ../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/codegen_tests
#rm -rf $OUTPUT