resolve_schema

Function resolve_schema 

Source
pub fn resolve_schema(
    schema_name: Option<&str>,
    ctx: &ConfigContext,
) -> Result<ResolvedSchema, TemplatesError>
Expand description

Resolves a schema name into a ResolvedSchema.

If schema_name is None, the default schema name is used. Resolution precedence is project-local -> user -> embedded -> package; the returned ResolvedSchema contains the loaded SchemaYaml, the directory or embedded path that contained schema.yaml, and a SchemaSource indicating where it was found.

§Parameters

  • schema_name: Optional schema name to resolve; uses the module default when None.
  • ctx: Configuration context used to locate project and user schema paths.

§Errors

Returns WorkflowError::SchemaNotFound(name) when the schema cannot be located. Other WorkflowError variants may be returned for IO or YAML parsing failures encountered while loading schema.yaml.

§Examples

// Resolves the default schema using `ctx`.
let resolved = resolve_schema(None, &ctx).expect("schema not found");
println!("Resolved {} from {}", resolved.schema.name, resolved.schema_dir.display());