SchemaErrorsModule
PackageReified.Schema
Functions for inspecting and rendering accumulated schema failures.
Summary
| Name | Signature | Synopsis |
|---|---|---|
| toList | SchemaErrors.toList errors | Returns failures in deterministic path order. |
| count | SchemaErrors.count errors | Returns the number of accumulated failures. |
| isEmpty | SchemaErrors.isEmpty errors | Reports whether the collection contains no failures. |
| toString | SchemaErrors.toString errors | Renders one line per failure. |
| messages | SchemaErrors.messages renderer errors | Renders each failure as a localized predicate, paired with the path it occurred at. |
| fullMessages | SchemaErrors.fullMessages renderer errors | Renders each failure as a complete fragment with its attribute noun, paired with its path. |
| toStringWith | SchemaErrors.toStringWith renderer errors | Renders one localized line per failure. |
Returns failures in deterministic path order.
Parameters
| Name | Type | Description |
|---|---|---|
| errors | SchemaErrors |
Returns
SchemaIssue list
Returns the number of accumulated failures.
Parameters
| Name | Type | Description |
|---|---|---|
| errors | SchemaErrors |
Returns
int
Reports whether the collection contains no failures.
Parameters
| Name | Type | Description |
|---|---|---|
| errors | SchemaErrors |
Returns
bool
Renders one line per failure.
Parameters
| Name | Type | Description |
|---|---|---|
| errors | SchemaErrors |
Returns
string
Renders each failure as a localized predicate, paired with the path it occurred at.
Parameters
| Name | Type | Description |
|---|---|---|
| renderer | Renderer | |
| errors | SchemaErrors |
Returns
(SchemaPath * string) list
Verification Examples
errors |> SchemaErrors.messages (renderer |> Renderer.context "signup")
// [ SchemaPath "name", "must be present" ]Renders each failure as a complete fragment with its attribute noun, paired with its path.
Parameters
| Name | Type | Description |
|---|---|---|
| renderer | Renderer | |
| errors | SchemaErrors |
Returns
(SchemaPath * string) list
Verification Examples
errors |> SchemaErrors.fullMessages (renderer |> Renderer.context "signup")
// [ SchemaPath "name", "Name must be present" ]