mirror of
https://github.com/ModernRelay/omnigraph.git
synced 2026-06-30 02:49:39 +02:00
Add static OpenAPI spec and Stainless SDK config
Introduce SDK generation scaffolding: commit a static openapi.json extracted from the Utoipa annotations via a golden-file test, add Stainless workspace/config for TypeScript and Python SDKs, and clean up operation IDs for ergonomic generated method names. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9ad9d1f71f
commit
228032a4ac
6 changed files with 1887 additions and 0 deletions
|
|
@ -962,3 +962,28 @@ async fn auth_mode_healthz_still_has_no_security() {
|
|||
"auth-mode: /healthz should still have no security"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn openapi_spec_is_up_to_date() {
|
||||
let spec_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../../openapi.json");
|
||||
|
||||
let generated = serde_json::to_string_pretty(&openapi_doc()).unwrap() + "\n";
|
||||
|
||||
if env::var("OMNIGRAPH_UPDATE_OPENAPI").is_ok() {
|
||||
fs::write(&spec_path, &generated).unwrap();
|
||||
return;
|
||||
}
|
||||
|
||||
let committed = fs::read_to_string(&spec_path).unwrap_or_else(|_| {
|
||||
panic!(
|
||||
"openapi.json not found at {}. Run: OMNIGRAPH_UPDATE_OPENAPI=1 cargo test -p omnigraph-server --test openapi openapi_spec_is_up_to_date",
|
||||
spec_path.display()
|
||||
)
|
||||
});
|
||||
|
||||
assert_eq!(
|
||||
committed, generated,
|
||||
"openapi.json is out of date. Run: OMNIGRAPH_UPDATE_OPENAPI=1 cargo test -p omnigraph-server --test openapi openapi_spec_is_up_to_date"
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue