chore: fix python client build (#5856)

* chore: fix python client build

* nit
This commit is contained in:
pyranota
2025-06-03 00:05:12 +02:00
committed by GitHub
parent 8f29c9d333
commit 697f660532
4 changed files with 25 additions and 4 deletions
+17 -3
View File
@@ -1,8 +1,22 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
mkdir openapi || true
cp ../backend/windmill-api/openapi.yaml openapi/openapi.yaml
# cp ../backend/windmill-api/openapi.yaml openapi/openapi.yaml
LEGACY_WILDCARD="\$ref: \"..\/..\/openflow.openapi.yaml#\/components\/schemas\""
# We will need to use old syntax of openapi to maintain compatability with previous windmill-api versions.
# If we use new format, many models use another namespace, thus make it not fully compatible with old versions
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS version using perl
perl -0777 -pe "s/# -- INLINE START --\n.*?# -- INLINE END --\n/$LEGACY_WILDCARD\n/s" \
../backend/windmill-api/openapi.yaml > openapi/openapi.yaml
else
# Replace everything between markers with legacy wildcard
sed -z "
s/# -- INLINE START --\n.*# -- INLINE END --\n/$LEGACY_WILDCARD\n/g;
" ../backend/windmill-api/openapi.yaml > openapi/openapi.yaml
fi
npx @redocly/openapi-cli@latest bundle openapi/openapi.yaml > openapi-bundled.yaml
@@ -10,7 +24,7 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
# sed -z is not supported on macOS, use perl instead
perl -0777 -pe 's/FlowModuleValue:/FlowModuleValue2:/g' openapi-bundled.yaml > openapi-decycled.yaml
else
sed -z 's/FlowModuleValue:/FlowModuleValue2:/' openapi-bundled.yaml > openapi-decycled.yaml
sed -z 's/FlowModuleValue:/FlowModuleValue2:/' openapi-bundled.yaml > openapi-decycled.yaml
fi
echo " FlowModuleValue: {}" >> openapi-decycled.yaml
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
./build.sh