SchemaErrorsModule

PackageReified.Schema
Functions for inspecting and rendering accumulated schema failures.

Summary

NameSignatureSynopsis
toListSchemaErrors.toList errorsReturns failures in deterministic path order.
countSchemaErrors.count errorsReturns the number of accumulated failures.
isEmptySchemaErrors.isEmpty errorsReports whether the collection contains no failures.
toStringSchemaErrors.toString errorsRenders one line per failure.
messagesSchemaErrors.messages renderer errorsRenders each failure as a localized predicate, paired with the path it occurred at.
fullMessagesSchemaErrors.fullMessages renderer errorsRenders each failure as a complete fragment with its attribute noun, paired with its path.
toStringWithSchemaErrors.toStringWith renderer errorsRenders one localized line per failure.

toList

SchemaErrors.toList errors
Member
Returns failures in deterministic path order.

Parameters

NameTypeDescription
errorsSchemaErrors

Returns

SchemaIssue list

count

SchemaErrors.count errors
Member
Returns the number of accumulated failures.

Parameters

NameTypeDescription
errorsSchemaErrors

Returns

int

isEmpty

SchemaErrors.isEmpty errors
Member
Reports whether the collection contains no failures.

Parameters

NameTypeDescription
errorsSchemaErrors

Returns

bool

toString

SchemaErrors.toString errors
Member
Renders one line per failure.

Parameters

NameTypeDescription
errorsSchemaErrors

Returns

string

messages

SchemaErrors.messages renderer errors
Member
Renders each failure as a localized predicate, paired with the path it occurred at.

Parameters

NameTypeDescription
rendererRenderer
errorsSchemaErrors

Returns

(SchemaPath * string) list

Verification Examples

errors |> SchemaErrors.messages (renderer |> Renderer.context "signup")
 // [ SchemaPath "name", "must be present" ]

fullMessages

SchemaErrors.fullMessages renderer errors
Member
Renders each failure as a complete fragment with its attribute noun, paired with its path.

Parameters

NameTypeDescription
rendererRenderer
errorsSchemaErrors

Returns

(SchemaPath * string) list

Verification Examples

errors |> SchemaErrors.fullMessages (renderer |> Renderer.context "signup")
 // [ SchemaPath "name", "Name must be present" ]

toStringWith

SchemaErrors.toStringWith renderer errors
Member
Renders one localized line per failure.

Parameters

NameTypeDescription
rendererRenderer
errorsSchemaErrors

Returns

string

Verification Examples

errors |> SchemaErrors.toStringWith (renderer |> Renderer.context "signup")