Add pre-commit hook for openapi.json drift

Wire a local pre-commit hook that regenerates openapi.json whenever
the server source changes, and document the workflow in CONTRIBUTING.
Opt-in via `pre-commit install`; the existing CI test remains the
authoritative drift check.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ragnor Comerford 2026-04-17 15:53:13 +02:00
parent bfdfeaa2f2
commit 7c6d89d194
No known key found for this signature in database
2 changed files with 28 additions and 0 deletions

View file

@ -16,6 +16,24 @@ cargo test --workspace
If you touch S3-backed flows, the CI model uses a local RustFS instance for
integration tests.
### OpenAPI spec
`openapi.json` is a committed artifact generated from the Utoipa annotations in
`crates/omnigraph-server`. CI fails if it drifts from the source. To regenerate
manually:
```bash
OMNIGRAPH_UPDATE_OPENAPI=1 cargo test -p omnigraph-server --test openapi openapi_spec_is_up_to_date
```
Optional: install [pre-commit](https://pre-commit.com) to run this automatically
before each commit that touches the server:
```bash
pip install pre-commit
pre-commit install
```
## Pull Requests
- keep changes focused