Skip to main content

generate_object_struct

Function generate_object_struct 

Source
pub fn generate_object_struct(
    name: &str,
    schema: &Schema,
    obj: &ObjectType,
    inline_types: &mut Vec<TokenStream>,
) -> TokenStream
Expand description

Generate a struct from an object schema.

Declared properties become fields; when the schema also carries an additionalProperties entry, a flattened HashMap catch-all field is added. A schema with no declared properties (a pure map) instead becomes a HashMap type alias.