Validates compiled WPL JSON against the canonical schema and semantic invariants.
Two passes:
- JSON Schema validation (Draft 2020-12).
- Semantic invariants (duplicate-id detection, ref resolution, prescription validity, etc.) — only runs if Pass 1 passes.
Usage
{:ok, plan} = Jason.decode(json_string)
result = WPL.Validator.validate(plan)
if result.valid? do
IO.puts("ok")
else
for err <- result.errors, do: IO.inspect(err)
endSee WPL.Validator.Error and WPL.Validator.Result for return shapes.
Summary
Types
Functions
@spec validate(any(), opts()) :: WPL.Validator.Result.t()