pub struct Example {
pub summary: Option<String>,
pub description: Option<String>,
pub value: Option<ValueRef>,
pub external_value: Option<String>,
pub data_value: Option<ValueRef>,
pub serialized_value: Option<String>,
}Expand description
OAS Example Object. Carried in a Vec<(String, Example)> on
Parameter / BodyContent / NamedType (named, ordered).
3.0 specs that declare a single bare example (no name) are
stored under the synthetic key "_default" so generators have
one shape to read.
value is the inline literal — a ValueRef indexing into the IR’s
value pool. external_value is the spec’s URL escape hatch and is
mutually exclusive with value; the parser warns and keeps value
when both are declared.
Fields§
§summary: Option<String>§description: Option<String>§value: Option<ValueRef>§external_value: Option<String>§data_value: Option<ValueRef>OAS 3.2 dataValue — the parsed/decoded form of the example.
Spec splits the 3.0/3.1 value into dataValue (parsed) and
serializedValue (wire form) so generators can pick the
representation that matches their language. ValueRef indexes
into Ir::values.
serialized_value: Option<String>OAS 3.2 serializedValue — the wire form as a string (e.g. the
JSON text, urlencoded body). Mutually exclusive with
external_value.