resolve_templates

Function resolve_templates 

Source
pub fn resolve_templates(
    schema_name: Option<&str>,
    ctx: &ConfigContext,
) -> Result<(String, BTreeMap<String, TemplateInfo>), TemplatesError>
Expand description

Resolve template paths for every artifact in a schema.

If schema_name is None, the schema is resolved using project -> user -> embedded -> package precedence. For embedded schemas each template path is returned as an embedded://schemas/{name}/templates/{file} URI; for filesystem-backed schemas each template path is an absolute filesystem string.

Returns the resolved schema name and a map from artifact id to TemplateInfo (contains source and path).

§Examples

// Obtain a ConfigContext from your application environment.
let ctx = /* obtain ConfigContext */ unimplemented!();
let (schema_name, templates) = resolve_templates(None, &ctx).unwrap();
// `templates` maps artifact ids to TemplateInfo with `source` and `path`.