Skip to content

Commit 275dc9d

Browse files
authored
Merge pull request #1264 from NanaKhadija1980j/feat/1260-openapi-swagger-docs
feat: add OpenAPI/Swagger API documentation (#1260)
2 parents 07fba8b + d265bf0 commit 275dc9d

7 files changed

Lines changed: 808 additions & 31 deletions

File tree

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
dev-setup dev-setup-rust dev-setup-tools dev-setup-hooks pre-commit pre-commit-install run run-local run-dev \
2525
install-crd apply-samples crd-gen regenerate completions completions-bash completions-zsh completions-fish \
2626
helm-lint link-check link-check-all changelog \
27-
generate-api-docs check-api-docs check-stale-docs update-doc-baseline docs-check-strict docs-lint \
27+
generate-api-docs check-api-docs generate-openapi-spec check-openapi-spec check-stale-docs update-doc-baseline docs-check-strict docs-lint \
2828
third-party-licenses check-third-party-licenses sort-manifests \
2929
benchmark benchmark-upgrade benchmark-webhook benchmark-webhook-health \
3030
benchmark-webhook-compare benchmark-webhook-save benchmark-all \
@@ -282,6 +282,15 @@ check-api-docs: ## Check API docs are up to date (used in CI)
282282
--output docs/api-reference.md \
283283
--check
284284

285+
generate-openapi-spec: ## Validate operator REST OpenAPI specification
286+
@echo "→ Validating OpenAPI specification..."
287+
@python3 scripts/generate-openapi-spec.py --spec docs/api/openapi.yaml
288+
@echo "✓ docs/api/openapi.yaml is valid"
289+
290+
check-openapi-spec: ## Fail if OpenAPI spec is missing required operator routes
291+
@echo "→ Checking OpenAPI spec coverage..."
292+
@python3 scripts/generate-openapi-spec.py --spec docs/api/openapi.yaml --check
293+
285294
check-stale-docs: ## Check for documentation that has fallen behind source code (warns; use docs-check-strict to fail)
286295
@echo "→ Checking for stale documentation..."
287296
@$(CARGO) run --bin doc-check -- --warn-only

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,12 +613,20 @@ The full `StellarNode` CRD field reference — including all fields, types, defa
613613

614614
**[docs/api-reference.md](docs/api-reference.md)**
615615

616-
The reference is auto-generated from the CRD OpenAPI schema. To regenerate after modifying the CRD types:
616+
The CRD reference is auto-generated from the CRD OpenAPI schema. To regenerate after modifying the CRD types:
617617

618618
```bash
619619
make generate-api-docs
620620
```
621621

622+
Operator REST endpoints are documented in **[docs/api/openapi.yaml](docs/api/openapi.yaml)** (OpenAPI 3.0). Validate coverage with:
623+
624+
```bash
625+
make check-openapi-spec
626+
```
627+
628+
Interactive Swagger UI is available at `/developer` when the API gateway is enabled.
629+
622630
---
623631

624632
## 💻 Development

docs/api/index.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,28 @@ This directory contains the API reference and integration documentation for Stel
44

55
## Contents
66

7-
- [CRD API Reference](../api-reference.md)
8-
- [OpenAPI Specification](openapi.yaml)
7+
- [StellarNode CRD Reference](../api-reference.md) — field-level CRD schema (generated)
8+
- [OpenAPI Specification](openapi.yaml) — operator REST API (Swagger-compatible)
99
- [Webhook API](webhook.md)
1010
- [Metrics API](metrics.md)
1111
- [Client Libraries and SDK Guidance](client-libraries.md)
1212
- [Error Codes and Troubleshooting](error-codes.md)
1313

14+
## Swagger / OpenAPI
15+
16+
| Artifact | Location |
17+
|----------|----------|
18+
| Static OpenAPI 3.0 spec | `docs/api/openapi.yaml` |
19+
| Live JSON (API gateway) | `GET /gateway/openapi.json` |
20+
| Interactive Swagger UI | `GET /developer` (when gateway enabled) |
21+
22+
Validate the static spec locally:
23+
24+
```bash
25+
make generate-openapi-spec
26+
make check-openapi-spec
27+
```
28+
1429
## Overview
1530

1631
Stellar-K8s exposes the following integration layers:

0 commit comments

Comments
 (0)