effect-io-ai

Package: effect
Module: SchemaIssue

SchemaIssue.Forbidden

Represents a schema issue produced when a forbidden operation is encountered during parsing, such as an asynchronous Effect running inside Schema.decodeUnknownSync.

When to use

Use when you need to detect that a schema requires async execution but was run synchronously.

Details

Example (Creating a Forbidden issue)

import { Option, SchemaIssue } from "effect"

const issue = new SchemaIssue.Forbidden(
  Option.none(),
  { message: "async operation not allowed in sync context" }
)
console.log(String(issue))
// "async operation not allowed in sync context"

See

Signature

declare class Forbidden { constructor(
    /**
     * The input value that caused the issue.
     */
    actual: Option.Option<unknown>,
    /**
     * The metadata for the issue.
     */
    annotations: Schema.Annotations.Issue | undefined
  ) }

Source

Since v3.10.0