effect-io-ai

Package: effect
Module: Schema

Schema.annotate

Adds metadata annotations to a schema without changing its runtime behavior. This is the pipeable (curried) counterpart of the .annotate method.

Details

Annotations provide extra context used by documentation generators, JSON Schema converters, error formatters, and other tooling. Common keys include title, description, examples, message, and identifier.

Example (Adding a title and description)

import { Schema } from "effect"

const Age = Schema.Natural.pipe(
  Schema.annotate({
    title: "Age",
    description: "A non-negative integer representing age in years"
  })
)

See

Signature

declare const annotate: <S extends Top>(annotations: Annotations.Bottom<S["Type"], S["~type.parameters"]>) => (self: S) => S["Rebuild"]

Source

Since v4.0.0