Selecto.Domain.Contract (Selecto v0.4.6)

Copy Markdown

First-wave canonical domain contract checks.

This module validates the normalized shape produced by Selecto.Domain. It is intentionally small: it covers the required core sections and the first strict subschemas for source, schemas, joins, and filter references. Existing runtime configuration does not call this module unless a caller opts into normalized validation.

Summary

Functions

Returns structured contract errors for a normalized domain.

Returns :ok when a normalized domain satisfies the first-wave contract.

Types

error()

@type error() :: %{code: atom(), message: String.t(), path: [term()]}

Functions

errors(normalized_domain)

@spec errors(map()) :: [error()]

Returns structured contract errors for a normalized domain.

validate(normalized_domain)

@spec validate(map()) :: :ok | {:error, [error()]}

Returns :ok when a normalized domain satisfies the first-wave contract.