effect-io-ai

Package: effect
Module: SchemaGetter

SchemaGetter.forbidden

Creates a getter that always fails with a Forbidden issue.

When to use

Use when you need a schema getter to disallow a field or direction (encode/decode) entirely.

Details

Example (Forbidding a decode direction)

import { SchemaGetter } from "effect"

const noEncode = SchemaGetter.forbidden<string, number>(
  () => "encoding is not supported"
)

See

Signature

declare const forbidden: <T, E>(message: (oe: Option.Option<E>) => string) => Getter<T, E>

Source

Since v4.0.0