EncodingRepresents a schema issue produced when a schema transformation (encode/decode step) fails.
When to use
Use when you need to inspect failures from Schema.decodeTo / Schema.encodeTo
transformations.
Details
astis the AST node for the transformation that failed.actualisOption.some(value)when the input was present, orOption.none()when it was absent.issueis the inner issue describing the failure.
export class class Encodingclass Encoding {
_tag: 'Encoding';
ast: SchemaAST.AST;
actual: Option.Option<unknown>;
issue: Issue;
toString: (this: Issue) => string;
}
Represents a schema issue produced when a schema transformation (encode/decode step) fails.
When to use
Use when you need to inspect failures from Schema.decodeTo / Schema.encodeTo
transformations.
Details
ast is the AST node for the transformation that failed.
actual is Option.some(value) when the input was present, or
Option.none() when it was absent.
issue is the inner issue describing the failure.
Encoding extends class BaseBase {
readonly Encoding._tag: "Encoding"_tag = "Encoding"
/**
* The schema that caused the issue.
*/
readonly Encoding.ast: SchemaAST.ASTThe schema that caused the issue.
ast: import SchemaASTSchemaAST.type SchemaAST.AST = /*unresolved*/ anyAST
/**
* The input value that caused the issue.
*/
readonly Encoding.actual: Option.Option<unknown>The input value that caused the issue.
actual: import OptionOption.type Option.Option = /*unresolved*/ anyOption<unknown>
/**
* The issue that occurred.
*/
readonly Encoding.issue: IssueThe issue that occurred.
issue: type Issue =
| Leaf
| Filter
| Encoding
| Pointer
| Composite
| AnyOf
The root discriminated union of all validation error nodes.
When to use
Use when typing the error channel in Effect<A, Issue, R> results from
schema parsing, or when writing custom formatters or issue-tree walkers.
Details
Every node has a _tag field for pattern-matching. The union includes both
terminal
Leaf
types and composite types that wrap inner issues:
Filter
,
Encoding
,
Pointer
,
Composite
,
AnyOf
. All Issue instances have a toString() that delegates to
the default formatter, so String(issue) produces a human-readable message.
Issue
constructor(
/**
* The schema that caused the issue.
*/
ast: SchemaAST.ASTThe schema that caused the issue.
ast: import SchemaASTSchemaAST.type SchemaAST.AST = /*unresolved*/ anyAST,
/**
* The input value that caused the issue.
*/
actual: Option.Option<unknown>The input value that caused the issue.
actual: import OptionOption.type Option.Option = /*unresolved*/ anyOption<unknown>,
/**
* The issue that occurred.
*/
issue: IssueThe issue that occurred.
issue: type Issue =
| Leaf
| Filter
| Encoding
| Pointer
| Composite
| AnyOf
The root discriminated union of all validation error nodes.
When to use
Use when typing the error channel in Effect<A, Issue, R> results from
schema parsing, or when writing custom formatters or issue-tree walkers.
Details
Every node has a _tag field for pattern-matching. The union includes both
terminal
Leaf
types and composite types that wrap inner issues:
Filter
,
Encoding
,
Pointer
,
Composite
,
AnyOf
. All Issue instances have a toString() that delegates to
the default formatter, so String(issue) produces a human-readable message.
Issue
) {
super()
this.Encoding.ast: SchemaAST.ASTThe schema that caused the issue.
ast = ast: SchemaAST.ASTThe schema that caused the issue.
ast
this.Encoding.actual: Option.Option<unknown>The input value that caused the issue.
actual = actual: Option.Option<unknown>The input value that caused the issue.
actual
this.Encoding.issue: IssueThe issue that occurred.
issue = issue: IssueThe issue that occurred.
issue
}
}