@@ -62,20 +62,28 @@ lint:
6262# Speakeasy #
6363# ############
6464
65- # # client-generate: Pull the openapi spec from the free hosted API and generate the SDK
66- .PHONY : client-generate
67- client-generate :
68- wget -nv -q -O openapi.json https://api.unstructured.io/general/openapi.json
65+ # # download-openapi-specs: Download the openapi specs from the Serverless and Platform APIs
66+ .PHONY : download-openapi-specs
67+ download-openapi-specs :
68+ wget -nv -q -O openapi_serverless.json https://api.unstructured.io/general/openapi.json
69+ wget -nv -q -O openapi_platform_api.json https://platform.unstructuredapp.io/openapi.json
70+
71+ # # client-merge-serverless-platform: Merge the Serverless and Platform APIs specs into a single schema
72+ .PHONY : client-merge-serverless-platform
73+ client-merge-serverless-platform :
74+ speakeasy merge -s ./openapi_serverless.json -s ./openapi_platform_api.json -o ./openapi_merged.yaml
75+
76+ # # client-generate-unified-sdk-local: Generate the SDK using merged schemas
77+ .PHONY : client-generate-unified-sdk-local
78+ client-generate-unified-sdk-local :
6979 speakeasy overlay validate -o ./overlay_client.yaml
70- speakeasy overlay apply -s ./openapi.json -o ./overlay_client.yaml > ./openapi_client.json
71- speakeasy generate sdk -s ./openapi_client.json -o ./ -l python
80+ speakeasy overlay apply -s ./openapi_merged.yaml -o ./overlay_client.yaml > ./openapi_platform_serverless_client.yaml
81+ speakeasy generate sdk -s ./openapi_platform_serverless_client.yaml -o ./ -l python
82+
83+ # # client-generate-sdk: Do all the steps to generate the SDK
84+ .PHONY : client-generate-sdk
85+ client-generate-sdk : download-openapi-specs client-merge-serverless-platform client-generate-unified-sdk-local
7286
73- # # client-generate-local: Generate the SDK using a local copy of openapi.json
74- .PHONY : client-generate-local
75- client-generate-local :
76- speakeasy overlay validate -o ./overlay_client.yaml
77- speakeasy overlay apply -s ./openapi.json -o ./overlay_client.yaml > ./openapi_client.json
78- speakeasy generate sdk -s ./openapi_client.json -o ./ -l python
7987
8088.PHONY : publish
8189publish :
@@ -88,4 +96,4 @@ publish:
8896# # run-jupyter: starts jupyter notebook
8997.PHONY : run-jupyter
9098run-jupyter :
91- PYTHONPATH=$(realpath .) JUPYTER_PATH=$(realpath .) jupyter-notebook --NotebookApp.token=' ' --NotebookApp.password=' '
99+ PYTHONPATH=$(realpath .) JUPYTER_PATH=$(realpath .) jupyter-notebook --NotebookApp.token=' ' --NotebookApp.password=' '
0 commit comments