These specs back the framework round-trip recipes in docs/recipes.md
and the compatibility test spargen/tests/recipes.rs. Each one mirrors the OpenAPI document a
Rust server framework EMITS, so the test proves spargen actually consumes that framework's output
idioms (the round-trip Rust server → OpenAPI → spargen client).
They are hand-crafted (small, reviewable, deterministic) rather than captured from a running server, but each faithfully reproduces the framework's emitted structure and, crucially, the OpenAPI version that framework emits — verified against the framework's own source, pinned below. The test reads only these local files; it never hits the network.
| Spec | Framework | Emits | Expected | Verified against |
|---|---|---|---|---|
utoipa.json |
juhaku/utoipa 5.x |
OpenAPI 3.1.0 |
generate (clean) | OpenApiVersion::Version31 (#[serde(rename = "3.1.0")], #[default]) in utoipa/src/openapi.rs; exported via ApiDoc::openapi().to_pretty_json() |
aide.json |
tamasfe/aide |
OpenAPI 3.1.0 |
generate (only W001) |
serde_version serializes "3.1.0" in crates/aide/src/openapi/openapi.rs; component schemas come from schemars (JSON Schema 2020-12) |
poem-openapi.json |
poem-web/poem (poem-openapi) |
OpenAPI 3.0.0 |
reject E001 |
const OPENAPI_VERSION: &str = "3.0.0" in poem-openapi/src/registry/ser.rs; exported via OpenApiService::spec() |
utoipa-untagged-overlap.json |
juhaku/utoipa 5.x |
OpenAPI 3.1.0 |
generate (clean) | as utoipa.json; adds one #[serde(untagged)] numeric enum → typed trial-matching oneOf |
utoipa.json— 3.1 nullable primitive (type: ["string","null"]), nullable$ref(oneOfwith a{"type":"null"}member),allOf-composed model, adiscriminator-taggedoneOf, tag-grouped operations, path parameters, a multi-status response (200+404bodies), and anhttpbearer security scheme.aide.json— schemars-style nullables (anyOfwith{"type":"null"}andtype: ["integer","null"]), an externally-tagged enum (oneOfof closedadditionalProperties: falseobjects with unique required keys, dispatched by content), a by-JSON-type disjointoneOf(string | integer), anallOf#[serde(flatten)]composition, and a multi-status response. Theminimum/formatvalidation hints schemars emits are faithfully ignored (W001).poem-openapi.json— a 3.0.0 document (with 3.0-stylenullable: true); rejected on the version alone.utoipa-untagged-overlap.json— one clean operation plus one operation whose response is an overlapping untagged union (integer | number); both operations generate, and the overlap is represented by a typed enum with exact-one trial matching.
Because these are crafted, there is no upstream file hash to pin. To confirm the emitted versions
haven't drifted, re-check the source constants cited above (they are the load-bearing facts). If a
framework changes the OpenAPI version it emits, update the matching spec, the recipe in
docs/recipes.md, and the expected outcome in spargen/tests/recipes.rs together.