pub fn run(
    definitions: &BTreeMap<DefinitionPath, Schema>,
    operations: &mut Vec<Operation>,
    definition_path: &DefinitionPath,
    map_namespace: &impl MapNamespace,
    vis: &str,
    generate_schema: GenerateSchema<'_>,
    operation_feature: Option<&str>,
    state: impl RunState
) -> Result<RunResult, Error>
Expand description

Each invocation of this function generates a single type specified by the definition_path parameter along with its associated API operation functions.

Parameters

  • definitions: The definitions parsed from the OpenAPI spec that should be emitted as model types.

  • operations: The list of operations parsed from the OpenAPI spec that should be emitted as API functions. Note that this value will be mutated to remove the operations that are determined to be associated with the type currently being generated.

  • definition_path: The specific definition path out of the definitions collection that should be emitted.

  • map_namespace: An instance of the MapNamespace trait that controls how OpenAPI namespaces of the definitions are mapped to rust namespaces.

  • vis: The visibility modifier that should be emitted on the generated code.

  • operation_feature: If specified, all API functions will be emitted with a #[cfg(feature = "<this value>")] attribute. The attribute will also be applied to their optional parameters and response types, if any, and to common types for optional parameters and response types that are shared by multiple operations.

  • state: See the documentation of the RunState trait.