Skip to main content

ocserve_http/
doc.rs

1//! `GET /doc` — the OpenAPI contract (freeze parity).
2//!
3//! opencode 1.18.31 serves its complete OpenAPI 3.1.0 document at `/doc`
4//! (162 paths / 188 operations / 472 schemas, covering v1 + `/api/*` v2 +
5//! `/sync/*` + `/tui/*` in one tagged document). We vendor that exact document
6//! and serve it byte-for-byte so ocserve is self-describing and the
7//! spec-driven coverage guard / response validation have a stable oracle.
8//!
9//! The document is embedded at compile time so `/doc` works on a bare machine
10//! with no config or network (consistent with the "boots with defaults"
11//! invariant). Regenerate with `scripts/extract-spec.sh <tag>`.
12
13/// The frozen 1.18.31 document, byte-identical to the upstream tag's
14/// `packages/sdk/openapi.json` and to freeze's live `GET /doc` (verified
15/// 2026-10-08).
16///
17/// Lives in `ocserve-core` (`assets/openapi/<tag>.json`, embedded there) so it
18/// is packaged with the crate that owns it and reaches `cargo install` (the
19/// 0.3.0 defect: embedding from `bench/`, outside every crate root, is not in
20/// the `.crate` tarball; guard rule 30).
21pub const SPEC_JSON: &str = ocserve_core::spec::SPEC_JSON;