SchemaErrorModule

PackageReified.Schema
Functions for lowering and rendering boundary schema failures.

Summary

NameSignatureSynopsis
Union cases
IsConstructorFailedthis.IsConstructorFailedNo description available.
IsCustomthis.IsCustomNo description available.
IsExpectedObjectthis.IsExpectedObjectNo description available.
IsExpectedScalarthis.IsExpectedScalarNo description available.
IsExpectedManythis.IsExpectedManyNo description available.
IsBlankthis.IsBlankNo description available.
IsViolationthis.IsViolationNo description available.
IsInvalidFormatthis.IsInvalidFormatNo description available.
IsOmittedthis.IsOmittedNo description available.
IsParseOutOfRangethis.IsParseOutOfRangeNo description available.
IsUnknownTagthis.IsUnknownTagNo description available.
OmittedOmittedRequired boundary input was not supplied.
BlankBlankBoundary input was present but carried no value.
ExpectedScalarExpectedScalarA scalar was expected at this path.
ExpectedObjectExpectedObjectAn object was expected at this path.
ExpectedManyExpectedManyA collection was expected at this path.
InvalidFormatInvalidFormat expectedThe input could not be read as the named target type.
ParseOutOfRangeParseOutOfRange targetThe input was well-formed but outside the target type's representable range.
UnknownTagUnknownTag choicesA union or enum discriminator did not name one of the declared cases.
ViolationViolation violationThe value was read successfully and then failed its constraint.
ConstructorFailedConstructorFailed messageThe model constructor rejected an otherwise admissible set of field values.
CustomCustom(code, message)A Schema-owned intrinsic check failed.
Operations
ofParseErrorSchemaError.ofParseError errorLowers a parse failure.
renderSchemaError.render errorRenders a schema error as an English sentence.

Union cases

kind:member

IsConstructorFailed

this.IsConstructorFailed
Member

Returns

bool
kind:member

IsCustom

this.IsCustom
Member

Returns

bool
kind:member

IsExpectedObject

this.IsExpectedObject
Member

Returns

bool
kind:member

IsExpectedScalar

this.IsExpectedScalar
Member

Returns

bool
kind:member

IsExpectedMany

this.IsExpectedMany
Member

Returns

bool
kind:member

IsBlank

this.IsBlank
Member

Returns

bool
kind:member

IsViolation

this.IsViolation
Member

Returns

bool
kind:member

IsInvalidFormat

this.IsInvalidFormat
Member

Returns

bool
kind:member

IsOmitted

this.IsOmitted
Member

Returns

bool
kind:member

IsParseOutOfRange

this.IsParseOutOfRange
Member

Returns

bool
kind:member

IsUnknownTag

this.IsUnknownTag
Member

Returns

bool
kind:member

Omitted

Omitted
Member
Required boundary input was not supplied.

Returns

unit
kind:member

Blank

Blank
Member
Boundary input was present but carried no value. The parse-side lowering of a missing value.

Returns

unit
kind:member

ExpectedScalar

ExpectedScalar
Member
A scalar was expected at this path.

Returns

unit
kind:member

ExpectedObject

ExpectedObject
Member
An object was expected at this path.

Returns

unit
kind:member

ExpectedMany

ExpectedMany
Member
A collection was expected at this path.

Returns

unit
kind:member

InvalidFormat

InvalidFormat expected
Member
The input could not be read as the named target type.

Parameters

NameTypeDescription
expectedstring

Returns

unit
kind:member

ParseOutOfRange

ParseOutOfRange target
Member
The input was well-formed but outside the target type's representable range.

Parameters

NameTypeDescription
targetstring

Returns

unit
kind:member

UnknownTag

UnknownTag choices
Member
A union or enum discriminator did not name one of the declared cases.

Parameters

NameTypeDescription
choicesstring

Returns

unit
kind:member

Violation

Violation violation
Member
The value was read successfully and then failed its constraint.

Parameters

NameTypeDescription
violationViolation

Returns

unit
kind:member

ConstructorFailed

ConstructorFailed message
Member
The model constructor rejected an otherwise admissible set of field values.

Parameters

NameTypeDescription
messagestring

Returns

unit
kind:member

Custom

Custom(code, message)
Member
A Schema-owned intrinsic check failed.

Parameters

NameTypeDescription
codestring
messagestring option

Returns

unit

Operations

kind:member

ofParseError

SchemaError.ofParseError error
Member
Lowers a parse failure. Parsing failures never become constraint violations.

Parameters

NameTypeDescription
errorParseError

Returns

SchemaError

Verification Examples

ParseError.MissingValue "int" |> SchemaError.ofParseError
kind:member

render

SchemaError.render error
Member
Renders a schema error as an English sentence.

Parameters

NameTypeDescription
errorSchemaError

Returns

string

Verification Examples

SchemaError.render (SchemaError.InvalidFormat "int") // "Expected int format."