Expand description
File loader for $ref resolution.
$ref loads external YAML files. The
compose engine never touches the filesystem directly — it goes through the
FileLoader trait, so the shared fixtures supply a virtual in-memory file set
(the spec graph is the input; no disk needed). The only implementation today
is MemoryLoader; a disk + YAML backed loader is not implemented yet — when
added it plugs into the same trait without touching the engine.
Path normalization:
- absolute (
/…) paths pass through unchanged - relative paths get the basepath prefix (
basepath + '/' + path)
The loader receives the ALREADY-normalized absolute key, so cycle detection and the fixture map key on one canonical identifier.
Structs§
- Memory
Loader - In-memory loader over a fixed
{ key: doc }map. Shared fixtures pass a file set here; the engine resolves$refagainst it with no disk access. Keys are the normalized identifiers (normalizeoutput).
Traits§
- File
Loader - Loads a normalized file key to its parsed document.
loadreturnsComposeLoadError(REF_FILE_NOT_FOUND)when the key is absent — the engine relies on that exact code (an unresolved$refis a load error, nevervalid:true).
Type Aliases§
- Loaded
Doc - A loaded YAML document (a parsed object tree). Always an object map at the top.