-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
26 lines (19 loc) · 930 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.PHONY: *
all: speakeasy
speakeasy: check-speakeasy
speakeasy generate sdk --lang typescript -o . -s ./openapi.yaml
speakeasy-validate: check-speakeasy
speakeasy validate openapi -s ./openapi.yaml
openapi:
curl https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.yaml > ./openapi.yaml
# This will replace the generation source in your workflow file with your local schema path
generate-from-local:
@if ! which sed >/dev/null; then \
echo "sed is not installed. Please install it using the following command:"; \
echo "For Ubuntu/Debian: apt-get install sed"; \
echo "For macOS: sed is pre-installed"; \
exit 1; \
fi
@sed -i '' '/openapi_docs: |/{n;s|-.*|- ./openapi.yaml|;}' ./.github/workflows/speakeasy_sdk_generation.yml
check-speakeasy:
@command -v speakeasy >/dev/null 2>&1 || { echo >&2 "speakeasy CLI is not installed. Please install before continuing."; exit 1; }