Skip to main content

cerno_openapi/
cerno-openapi.rs

1//! Prints the OpenAPI document.
2//!
3//! `spec/openapi.json` is generated from this, and `the_checked_in_spec_matches_the_code` in the
4//! server's test suite fails when the checked-in copy drifts from the code. The SDKs are written
5//! against the spec, so a silent drift would be a silent API break in three languages at once.
6
7use cerno_server::ApiDoc;
8use utoipa::OpenApi;
9
10fn main() {
11    println!(
12        "{}",
13        ApiDoc::openapi()
14            .to_pretty_json()
15            .expect("the derived document always serialises")
16    );
17}