k8s_openapi_codegen_common

Function run

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

Each invocation of this function generates a single type specified by the definition_path parameter.

ยง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. The list is 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.

  • state: See the documentation of the RunState trait.