add go-client mvp + stabilize openapi (#732)

This commit is contained in:
Ruben Fiszel
2022-10-14 16:26:51 +02:00
committed by GitHub
parent 7a4ceb318e
commit b7b5445874
12 changed files with 326 additions and 48 deletions
+1
View File
@@ -3,3 +3,4 @@ dist/
__pycache__/
openapi.yaml
openflow.openapi.yaml
windmill-api/
+7 -7
View File
@@ -1,18 +1,18 @@
#!/bin/bash
set -e
#TODO: remove once openapi-python-client supports recursive values
cp ../openflow.openapi.yaml ../openflow.openapi.yaml.tmp
sed -z 's/ ForloopFlow:\n type: object\n properties:\n modules:\n type: array\n items:\n $ref: "#\/components\/schemas\/FlowModule"/ ForloopFlow:\n type: object\n properties:/' ../openflow.openapi.yaml > ../openflow.openapi.yaml.new
mv ../openflow.openapi.yaml.new ../openflow.openapi.yaml
cp ../backend/openapi.yaml openapi.yaml
swagger-cli bundle -r openapi.yaml -o openapi-deref.yaml
npx @redocly/openapi-cli@latest bundle openapi.yaml > openapi-bundled.yaml
sed -z 's/FlowModuleValue:/FlowModuleValue2:/' openapi-bundled.yaml > openapi-decycled.yaml
echo " FlowModuleValue: {}" >> openapi-decycled.yaml
npx @redocly/openapi-cli@latest bundle openapi-decycled.yaml --ext json -d > openapi-deref.json
rm openapi.yaml && mv ../openflow.openapi.yaml.tmp ../openflow.openapi.yaml
rm -rf windmill-api/ || true
openapi-python-client generate --config $PWD/python-gen.yaml --path openapi-deref.yaml
openapi-python-client generate --config $PWD/python-gen.yaml --path openapi-deref.json
rm openapi*
cp LICENSE windmill-api/
sed -i '5 i license = "Apache-2.0"' windmill-api/pyproject.toml