-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (26 loc) · 1.07 KB
/
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
27
28
29
30
31
32
# Makefile
# Variables
URL := https://raw.githubusercontent.com/figma/rest-api-spec/refs/heads/main/openapi/openapi.yaml
OPENAPIFILE := OpenAPI/openapi.yaml
CONFIG := OpenAPI/openapi-generator-config.yaml
OUTPUT := Sources/FigmaAPI
# Targets
.PHONY: all download patch generate
all: download patch generate
download:
@curl -sS -o $(OPENAPIFILE) $(URL)
@echo "Download completed. $(OPENAPIFILE)"
patch:
# swift-openapi-generator has an issue with type: "null"; Workaround is to convert "null" to null (without quotes)
# See https://github.com/apple/swift-openapi-generator/issues/553
# See https://github.com/apple/swift-openapi-generator/issues/565
@git apply OpenAPI/Patches/remove-type-null-quotes.patch
# Responses may lack the type field in Hyperlink objects
@git apply OpenAPI/Patches/remove-hyperlink-required-type.patch
# Responses return CUSTOM_BEZIER insted of CUSTOM_CUBIC_BEZIER
@git apply OpenAPI/Patches/rename-custom-cubic-bezier.patch
generate:
@swift run swift-openapi-generator generate \
--config $(CONFIG) \
--output-directory $(OUTPUT) \
$(OPENAPIFILE)