Skip to main content

reachable_schemas

Function reachable_schemas 

Source
pub fn reachable_schemas(
    analysis: &SchemaAnalysis,
    ops: &[&OperationInfo],
) -> BTreeSet<String>
Expand description

Compute the set of schema names transitively reachable from the request/response/parameter shapes of the given operations.

Used by [server].prune_models = true to drop unreferenced types from types.rs. Walks every $ref in each schema’s raw JSON (AnalyzedSchema.original) rather than the analyzer’s dependencies field — the latter is incomplete for some schemas (e.g. struct fields whose target schemas weren’t individually tracked).

Inline parameter enums (whose rust_type is a synthetic name without a matching analysis.schemas entry) are not the responsibility of this walk — they’re emitted directly by the server codegen from parameter.enum_values.