V0.6.2 docs openapi (#37)
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-frontend (push) Successful in 6s
CI/CD / test-go-pg (push) Successful in 2m46s
CI/CD / test-sqlite (push) Successful in 2m49s
CI/CD / build-and-deploy (push) Successful in 28s

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #37.
This commit is contained in:
2026-03-31 12:01:51 +00:00
committed by xcaliber
parent 1a7f41493d
commit a887b4c78b
32 changed files with 3862 additions and 548 deletions

View File

@@ -2,6 +2,83 @@
All notable changes to Switchboard Core are documented here.
## v0.6.2 — Docs Polish + Dynamic OpenAPI
Docs surface polish and dynamic OpenAPI spec with extension route merging.
### Added
- **Dynamic OpenAPI spec**: `GET /api/docs/openapi.json` builds a merged
spec at request time — kernel endpoints + auto-generated stubs for every
extension `api_routes` entry. Extensions may optionally declare `api_schema`
in `manifest.json` for richer path items (params, body, response examples).
- **`api_schema` manifest field**: Optional array in `manifest.json`. Malformed
entries are logged and skipped — never blocks extension loading.
- **Tests**: 7 new handler tests (zero extensions, stubs, rich schema,
multi-extension, malformed schema, disabled exclusion, required fields).
### Fixed
- **Dark mode contrast**: Replaced all hardcoded light-mode fallbacks in docs
CSS with theme-aware CSS variables. Tables, code blocks, nav items, and
headings now readable in dark mode.
- **Docs loading state**: Replaced borrowed `settings-placeholder` animation
with docs-specific pulse skeleton. Added error state with retry button.
- **Docs routing**: Default route (`/docs`) now redirects to
`/docs/GETTING-STARTED` instead of the blank `/:section` placeholder.
- **Docs scrolling**: Content area now scrolls correctly — full document
visible without text overflowing viewport.
- **Docs icon**: Changed from 🧩 to 📖 in the user menu.
- **Docs duplicate menu entry**: Docs was appearing twice (once from surfaces
API, once from hardcoded items). Added `'docs'` to `CORE_IDS` filter.
- **Swagger UI**: Updated to point at dynamic `/api/docs/openapi.json`
endpoint. Static YAML preserved for backward compatibility.
- **OpenAPI tests on Postgres**: `openapiTestStores()` was hardcoded to
`sqlite.NewStores()` — caused `pq: syntax error at or near ","` in CI.
Now uses `database.IsSQLite()` check like all other handler tests.
### API
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/docs/openapi.json` | GET | Dynamic merged OpenAPI 3.0 spec |
---
## v0.6.1 — Backup/Restore + Documentation
Operational tooling for data safety and extension authoring.
### Added
- **Backup/Restore**: Full-instance backup as `.swb` ZIP archive containing
core tables (JSONL), ext_data tables, and package assets. Stream to client
or save server-side. Restore wipes and rebuilds from archive. Dialect-neutral
(works across SQLite and Postgres).
- **Admin backup section**: New "Backup" tab under `/admin` with create,
download, delete, and restore operations. Destructive restore requires
confirmation dialog.
- **Documentation surface**: Builtin surface at `/docs` with sidebar navigation
and client-side markdown rendering. Ships with 5 documents: Getting Started,
Extension Guide, API Reference, Deployment, Package Format.
- **Docs API**: `GET /api/v1/docs` lists available documents, `GET /api/v1/docs/:name`
returns raw markdown content. Authenticated (all users).
- **Tests**: 6 backup handler tests + E2E script (`ci/e2e-backup-test.sh`).
### API
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/v1/admin/backup` | POST | Create backup (stream or `?store=true`) |
| `/api/v1/admin/backups` | GET | List server-side backups |
| `/api/v1/admin/backups/:name` | GET | Download backup |
| `/api/v1/admin/backups/:name` | DELETE | Delete backup |
| `/api/v1/admin/restore` | POST | Restore from `.swb` upload |
| `/api/v1/docs` | GET | List documentation |
| `/api/v1/docs/:name` | GET | Get document content |
---
## v0.6.0 — Cluster Registry + HA
MVP convergence point. PG-backed cluster registry for horizontal scaling —