Skip to main content

flatten_refs

Function flatten_refs 

Source
pub fn flatten_refs(
    schema: &Value,
    base_dir: &Path,
    fetch_policy: FetchPolicy,
    load_budget: LoadBudget,
) -> EngineResult<Value>
Expand description

Inline every $ref in schema against the filesystem rooted at base_dir.

Relative refs in the schema (and in any document loaded transitively) resolve against the directory each ref originates from — the standard JSON Schema base-URI rule. The base URI is constructed from base_dir as an absolute file: URL.

§Errors

Returns CliError::Referencing for any ref-resolution failure (file not found, JSON parse error, cycle the underlying resolver can’t break, network/file refs denied by fetch policy, …), or an error when base_dir cannot be represented as an absolute file URI. The underlying error is wrapped with enough detail for an operator to find the bad ref.