pub struct Struct {
pub name: RustIdent,
pub doc: Option<String>,
pub deprecated: Option<Deprecation>,
pub fields: Vec<Field>,
pub additional_properties: Option<RustType>,
pub deny_unknown_fields: bool,
}Expand description
A generated struct.
Fields§
§name: RustIdentType name.
doc: Option<String>Doc comment derived from the schema description.
deprecated: Option<Deprecation>#[deprecated] annotation from deprecated: true (+ x-deprecated-reason).
fields: Vec<Field>Named fields, in deterministic order.
additional_properties: Option<RustType>When set, the struct captures unknown keys into a flattened map of this
element type (additionalProperties).
deny_unknown_fields: boolWhether the schema set additionalProperties: false, which becomes
#[serde(deny_unknown_fields)].
This is a field of its own and not the None case of
Self::additional_properties, because an absent additionalProperties
and an explicit false are different statements. An absent key permits
unknown keys and drops them, which is what serde does with no attribute.
An explicit false rejects them. Both give no flattened map, so the map
alone cannot tell them apart.