mirror of
https://github.com/Such-Software/smirk-backend-core.git
synced 2026-10-17 07:21:32 +02:00
- minimal Axum server exposing GET /health - OpenAPI contract generated from handlers (gen_openapi -> openapi.json), drift-gated in CI so the spec can never silently diverge from the code - CI: secret-scan + gitleaks, openapi drift gate, fmt/clippy/build/test/doc-test, cargo-deny - Cargo.lock tracked for reproducible builds; publish=false; pinned toolchain - README, SECURITY.md, deny.toml, .env.example
21 lines
640 B
Rust
21 lines
640 B
Rust
//! Emit the OpenAPI 3 specification to stdout.
|
|
//!
|
|
//! The spec is derived from the handlers (`utoipa` annotations) and is the
|
|
//! single source of truth for the API contract and the generated TypeScript
|
|
//! client. Regenerate the committed contract with:
|
|
//!
|
|
//! cargo run --bin gen_openapi > openapi.json
|
|
//!
|
|
//! CI regenerates and diffs against the committed `openapi.json`; a drift is a
|
|
//! failed build, not a stale doc.
|
|
|
|
use smirk_backend_core::api::openapi::ApiDoc;
|
|
use utoipa::OpenApi;
|
|
|
|
fn main() {
|
|
let spec = ApiDoc::openapi()
|
|
.to_pretty_json()
|
|
.expect("serialize OpenAPI spec");
|
|
println!("{spec}");
|
|
}
|