You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add automated OpenAPI specification generation for hosted documentation (#208)
* Refactor API routes into single source of truth
Extract route registration logic into internal/api/routes.go with
RegisterRoutes function. This ensures daemon and docs generation
use identical route definitions, maintaining 1:1 mapping between
code and documentation.
Introduces api.APIVersion constant as single source of truth for
API version used in OpenAPI spec and URL paths. The RegisterRoutes
function extracts this version from the router's OpenAPI spec and
returns the path prefix for logging.
All parameters require non-nil values with defensive checks using
reflection to prevent panics from interface nil checks.
Updates internal/daemon/api_server.go to use RegisterRoutes and
api.APIVersion constant, removing duplicate route registration code.
* Add OpenAPI specification generation tool
Introduce tools/docsgen/api/openapi.go for programmatic OpenAPI spec
export. The tool uses api.RegisterRoutes with stub implementations of
contracts to generate the spec without running the daemon.
Output is written to docs/api/openapi.yaml which is excluded from
version control via .gitignore, matching the pattern used for CLI
docs in docs/commands/.
This ensures a 1:1 mapping between the actual API code and the
published OpenAPI specification, automatically generated during
documentation deployment.
* Fix errcheck lint error in nav tool
Add error handling for encoder.Close() call in updateMkDocsNav
function to satisfy errcheck linter.
The encoder must be properly closed to flush any buffered output
before writing the final YAML to the file.
* Update build configuration for reorganized tools
Update Makefile targets to reflect new tools structure where each
standalone tool lives in its own directory (cmds/, nav/, api/)
rather than sharing tools/docsgen/cli/.
Add docs-api target to generate OpenAPI specification.
Configure golangci-lint to include build tags for all docsgen tools
and validate_registry, ensuring proper linting of build-tagged files
that were previously excluded from analysis.
* Integrate OpenAPI docs generation into CI pipeline
Add OpenAPI spec generation step to deploy-docs workflow between
CLI docs generation and navigation updates. This ensures the spec
is generated fresh on every docs deployment.
Update mkdocs.yaml to include API Reference section with link to
the generated OpenAPI specification file.
Update GitHub Actions versions across all workflows to latest
pinned releases for actions/checkout, actions/setup-go, and
astral-sh/setup-uv.
* Drop 'make docs-local' and just use 'make docs'
* make docs includes building OpenAPI too
- **Serve the docs locally using MkDocs + uv: generate CLI docs, update nav, serve locally**
146
141
```bash
147
142
make docs
148
143
```
149
144
150
145
!!! tip "First time?"
151
-
The `docs-local`command will create a virtual environment using `uv`, install MkDocs + Material theme, and start the local server at [http://localhost:8000](http://localhost:8000).
146
+
The `docs`command will create a virtual environment using `uv`, install MkDocs + Material theme, and start the local server at [http://localhost:8000/mcpd/](http://localhost:8000/mcpd/).
152
147
153
148
---
154
149
@@ -165,8 +160,7 @@ Here's a complete list of Makefile targets:
165
160
| `check-licenses` | Validate all dependency licenses are allowed |
166
161
| `check-notice` | Verify NOTICE file is up to date |
167
162
| `clean` | Remove compiled binary from working directory |
168
-
| `docs` | Alias for `docs-local` (runs everything) |
0 commit comments