Skip to content

Commit 2d07bd0

Browse files
committed
Add openapi spec
1 parent 0449a18 commit 2d07bd0

File tree

5 files changed

+419
-1
lines changed

5 files changed

+419
-1
lines changed

.github/workflows/main.yml

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
- name: Lint code
4848
run: make lint
4949

50+
- name: Check docs
51+
run: make docs
52+
5053
- name: Run unit tests
5154
env:
5255
TEST_SCHEMA_URI: "./etc/ecs-8.2.0.tar.gz"

.license_ignore

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ requirements.txt
1515
runtime.txt
1616
setup.cfg
1717

18+
docs/api-spec.html
19+
1820
scripts/generate-alerts.sh
1921
scripts/generate-network-events.sh
2022

Makefile

+9-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ else
2121
embed-python := $(error Embedding Python is not supported on this system)
2222
endif
2323

24+
REDOCLY := npx -y @redocly/cli
25+
2426
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
2527

2628
all: lint tests
@@ -35,6 +37,7 @@ prereq-go: prereq-py
3537
lint:
3638
$(PYTHON) -m black -q --check geneve tests || ($(PYTHON) -m black geneve tests; false)
3739
$(PYTHON) -m isort -q --check geneve tests || ($(PYTHON) -m isort geneve tests; false)
40+
$(REDOCLY) lint docs/api-spec.yaml
3841

3942
license-check:
4043
bash scripts/license_check.sh
@@ -95,6 +98,11 @@ package: pkg-build
9598
$(MAKE) pkg-install VENV=$(VENV)
9699
rm -rf $(VENV)
97100

101+
docs/api-spec.html: docs/api-spec.yaml
102+
$(REDOCLY) build-docs --output $@ $<
103+
104+
docs: docs/api-spec.html
105+
98106
CREDS_FILE=credentials-cloud-stack.json
99107

100108
cloud-stack-up:
@@ -138,4 +146,4 @@ override TEST_STACK_VERSION := $(shell \
138146
)
139147
endif
140148

141-
.PHONY: lint tests online_tests run up down
149+
.PHONY: docs lint tests online_tests run up down

0 commit comments

Comments
 (0)