ForbiddenRepresents 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
actualisOption.some(value)when the input is known, orOption.none()when absent.annotationsoptionally carries amessagestring.- The default formatter renders this as
"Forbidden operation".
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"export class class Forbiddenclass Forbidden {
_tag: 'Forbidden';
actual: Option.Option<unknown>;
annotations: Schema.Annotations.Issue | undefined;
toString: (this: Issue) => string;
}
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
actual is Option.some(value) when the input is known, or
Option.none() when absent.
annotations optionally carries a message string.
- The default formatter renders this as
"Forbidden operation".
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"
Forbidden extends class BaseBase {
readonly Forbidden._tag: "Forbidden"_tag = "Forbidden"
/**
* The input value that caused the issue.
*/
readonly Forbidden.actual: Option.Option<unknown>The input value that caused the issue.
actual: import OptionOption.type Option.Option = /*unresolved*/ anyOption<unknown>
/**
* The metadata for the issue.
*/
readonly Forbidden.annotations: anyThe metadata for the issue.
annotations: import SchemaSchema.declareAnnotations.type Schema.Annotations.Issue = /*unresolved*/ anyIssue | undefined
constructor(
/**
* 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 metadata for the issue.
*/
annotations: anyThe metadata for the issue.
annotations: import SchemaSchema.declareAnnotations.type Schema.Annotations.Issue = /*unresolved*/ anyIssue | undefined
) {
super()
this.Forbidden.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.Forbidden.annotations: anyThe metadata for the issue.
annotations = annotations: anyThe metadata for the issue.
annotations
}
}