Skip to main content

Function: mergeSchemaLayers()

mergeSchemaLayers(base, layers): SchemaYamlData

Defined in: packages/core/src/domain/services/merge-schema-layers.ts:967

Applies customisation layers to a base schema's intermediate representation.

Pure, synchronous function. Applies each layer's operations in fixed order (remove → create → prepend → append → set), then validates the result.

Parameters

base

SchemaYamlData

The base SchemaYamlData to customise

layers

readonly SchemaLayer[]

Ordered list of layers to apply

Returns

SchemaYamlData

A new SchemaYamlData with all layers applied

Throws

SchemaValidationError On identity collisions, missing entries, or post-merge violations