AnyOfRepresents a schema issue produced when a value does not match any member of a union schema.
When to use
Use when you need to inspect which union members were attempted and why each failed.
Details
astis theUnionAST node.actualis the raw input value (plainunknown).issuescontains per-member failures. When empty, the formatter falls back to the union'sexpectedannotation.
export class class AnyOfclass AnyOf {
_tag: 'AnyOf';
ast: SchemaAST.Union;
actual: unknown;
issues: ReadonlyArray<Issue>;
toString: (this: Issue) => string;
}
Represents a schema issue produced when a value does not match any member of a union schema.
When to use
Use when you need to inspect which union members were attempted and why each
failed.
Details
ast is the Union AST node.
actual is the raw input value (plain unknown).
issues contains per-member failures. When empty, the formatter falls
back to the union's expected annotation.
AnyOf extends class BaseBase {
readonly AnyOf._tag: "AnyOf"_tag = "AnyOf"
/**
* The schema that caused the issue.
*/
readonly AnyOf.ast: SchemaAST.Union(property) AnyOf.ast: {
_tag: 'Union';
types: ReadonlyArray<A>;
mode: "anyOf" | "oneOf";
encodingChecks: Checks | undefined;
getParser: (recur: (ast: AST) => SchemaParser.Parser) => SchemaParser.Parser;
_rebuild: (recur: (ast: AST) => AST, checks: Checks | undefined, encodingChecks: Checks | undefined) => Union<AST>;
recur: (recur: (ast: AST) => AST) => Union<AST>;
flip: (recur: (ast: AST) => AST) => Union<AST>;
matchPart: (s: string, options: ParseOptions) => LiteralValue | undefined;
getExpected: (getExpected: (ast: AST) => string) => string;
annotations: Schema.Annotations.Annotations | undefined;
checks: Checks | undefined;
encoding: Encoding | undefined;
context: Context | undefined;
toString: () => string;
}
The schema that caused the issue.
ast: import SchemaASTSchemaAST.type SchemaAST.Union = /*unresolved*/ anyUnion
/**
* The input value that caused the issue.
*/
readonly AnyOf.actual: unknownThe input value that caused the issue.
actual: unknown
/**
* The issues that occurred.
*/
readonly AnyOf.issues: ReadonlyArray<Issue>The issues that occurred.
issues: interface ReadonlyArray<T>ReadonlyArray<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.Union(parameter) ast: {
_tag: 'Union';
types: ReadonlyArray<A>;
mode: "anyOf" | "oneOf";
encodingChecks: Checks | undefined;
getParser: (recur: (ast: AST) => SchemaParser.Parser) => SchemaParser.Parser;
_rebuild: (recur: (ast: AST) => AST, checks: Checks | undefined, encodingChecks: Checks | undefined) => Union<AST>;
recur: (recur: (ast: AST) => AST) => Union<AST>;
flip: (recur: (ast: AST) => AST) => Union<AST>;
matchPart: (s: string, options: ParseOptions) => LiteralValue | undefined;
getExpected: (getExpected: (ast: AST) => string) => string;
annotations: Schema.Annotations.Annotations | undefined;
checks: Checks | undefined;
encoding: Encoding | undefined;
context: Context | undefined;
toString: () => string;
}
The schema that caused the issue.
ast: import SchemaASTSchemaAST.type SchemaAST.Union = /*unresolved*/ anyUnion,
/**
* The input value that caused the issue.
*/
actual: unknownThe input value that caused the issue.
actual: unknown,
/**
* The issues that occurred.
*/
issues: ReadonlyArray<Issue>The issues that occurred.
issues: interface ReadonlyArray<T>ReadonlyArray<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.AnyOf.ast: SchemaAST.Union(property) AnyOf.ast: {
_tag: 'Union';
types: ReadonlyArray<A>;
mode: "anyOf" | "oneOf";
encodingChecks: Checks | undefined;
getParser: (recur: (ast: AST) => SchemaParser.Parser) => SchemaParser.Parser;
_rebuild: (recur: (ast: AST) => AST, checks: Checks | undefined, encodingChecks: Checks | undefined) => Union<AST>;
recur: (recur: (ast: AST) => AST) => Union<AST>;
flip: (recur: (ast: AST) => AST) => Union<AST>;
matchPart: (s: string, options: ParseOptions) => LiteralValue | undefined;
getExpected: (getExpected: (ast: AST) => string) => string;
annotations: Schema.Annotations.Annotations | undefined;
checks: Checks | undefined;
encoding: Encoding | undefined;
context: Context | undefined;
toString: () => string;
}
The schema that caused the issue.
ast = ast: SchemaAST.Union(parameter) ast: {
_tag: 'Union';
types: ReadonlyArray<A>;
mode: "anyOf" | "oneOf";
encodingChecks: Checks | undefined;
getParser: (recur: (ast: AST) => SchemaParser.Parser) => SchemaParser.Parser;
_rebuild: (recur: (ast: AST) => AST, checks: Checks | undefined, encodingChecks: Checks | undefined) => Union<AST>;
recur: (recur: (ast: AST) => AST) => Union<AST>;
flip: (recur: (ast: AST) => AST) => Union<AST>;
matchPart: (s: string, options: ParseOptions) => LiteralValue | undefined;
getExpected: (getExpected: (ast: AST) => string) => string;
annotations: Schema.Annotations.Annotations | undefined;
checks: Checks | undefined;
encoding: Encoding | undefined;
context: Context | undefined;
toString: () => string;
}
The schema that caused the issue.
ast
this.AnyOf.actual: unknownThe input value that caused the issue.
actual = actual: unknownThe input value that caused the issue.
actual
this.AnyOf.issues: ReadonlyArray<Issue>The issues that occurred.
issues = issues: ReadonlyArray<Issue>The issues that occurred.
issues
}
}