Hyperlinkv0.8.0-beta.28

SchemaIssue

SchemaIssue.AnyOfclasseffect/SchemaIssue.ts:650
AnyOf

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.
export class AnyOf extends Base {
  readonly _tag = "AnyOf"
  /**
   * The schema that caused the issue.
   */
  readonly ast: SchemaAST.Union
  /**
   * The input value that caused the issue.
   */
  readonly actual: unknown
  /**
   * The issues that occurred.
   */
  readonly issues: ReadonlyArray<Issue>

  constructor(
    /**
     * The schema that caused the issue.
     */
    ast: SchemaAST.Union,
    /**
     * The input value that caused the issue.
     */
    actual: unknown,
    /**
     * The issues that occurred.
     */
    issues: ReadonlyArray<Issue>
  ) {
    super()
    this.ast = ast
    this.actual = actual
    this.issues = issues
  }
}
Referenced by 2 symbols