Snodo.Schema.Validator behaviour (snodo v0.1.0)

Copy Markdown View Source

Pluggable JSON Schema validation boundary.

Validators receive the untouched schema map registered by the application. Returning {:error, reason} marks an instance invalid; validators must not mutate either the instance or schema.

Snodo.Schema.Validator.Basic is the dependency-free common-subset implementation. Snodo.Schema.Validator.Passthrough remains the runtime default so selecting validation is an explicit application policy.

Summary

Callbacks

validate(instance, schema)

@callback validate(instance :: term(), schema :: map()) :: :ok | {:error, term()}