Skip to content

Commit 4b57b0f

Browse files
committed
add make command for generating the client
1 parent 7381425 commit 4b57b0f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ client-generate-local:
7777
speakeasy overlay apply -s ./openapi.json -o ./overlay_client.yaml > ./openapi_client.json
7878
speakeasy generate sdk -s ./openapi_client.json -o ./ -l python
7979

80+
## client-generate-localhost: Generate the SDK using the openapi.json from the unstructured-api running at localhost:5000
81+
.PHONY: client-generate-localhost
82+
client-generate-localhost:
83+
curl -o openapi.json http://localhost:5000/general/openapi.json || { echo "Failed to download openapi.json"; exit 1; }
84+
speakeasy overlay validate -o ./overlay_client.yaml
85+
speakeasy overlay apply -s ./openapi.json -o ./overlay_client.yaml > ./openapi_client.json
86+
python3 -c 'import sys, yaml, json; sys.stdout.write(json.dumps(yaml.safe_load(sys.stdin), indent=2))' < ./openapi_client.json > temp.json && mv temp.json ./openapi_client.json
87+
speakeasy generate sdk -s ./openapi_client.json -o ./ -l python
88+
8089
.PHONY: publish
8190
publish:
8291
./scripts/publish.sh

0 commit comments

Comments
 (0)