Expand description
Generators for oneOf / allOf / anyOf schema compositions.
oneOfโ Rust enum. Tagged via#[serde(tag = "...")]when the schema carries adiscriminator; otherwise#[serde(untagged)].anyOfโ Rust enum, always#[serde(untagged)](oneOfsemantics without the exclusivity guarantee is rarely useful in typed Rust).allOfโ Rust struct that merges its branches:$refbranches become#[serde(flatten)]fields; inline object branches inline their properties directly.
SchemaKind::Not and SchemaKind::Any remain unsupported and continue to
fall back to serde_json::Value in super::types.
Inline (non-top-level) compositions are synthesized into top-level types
using a deterministic name derived from the enclosing context (object name +
property, operation id + role). The accumulated definitions are emitted
alongside the explicit components/schemas items so all generated types
live at module scope.
Functionsยง
- generate_
all_ of - Generate a Rust struct type for an
allOfcomposition. - generate_
any_ of - Generate a Rust enum type for an
anyOfcomposition. - generate_
one_ of - Generate a Rust enum type for a
oneOfcomposition.