Skip to main content

Function: validateSpec()

validateSpec(input, capabilities?): GeoVisResult

Defined in: spec/validateSpec.ts:38

Validates a raw value against the GeoVis JSON Schema and enforces cross-field referential integrity rules not expressible in the schema. Returns a GeoVisResult: { status: 'resolved', spec, warnings } on success, or a failure status carrying every issue found in one pass — never only the first — so a repair loop can fix everything in one round trip.

capabilities, when provided (typically the active adapter's declared CapabilitySet), additionally rejects sources/layers/view features the adapter cannot render. Without it, only the schema-hardcoded default (feature-state joining restricted to geojson) is enforced — this keeps validateSpec usable standalone (CI, authoring tools) without an adapter.

Parameters

ParameterType
inputunknown
capabilities?CapabilitySet

Returns

GeoVisResult