Package: effect
Module: Schema
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
annotateEncoded to annotate the encoded side instead.Signature
declare const annotate: <S extends Top>(annotations: Annotations.Bottom<S["Type"], S["~type.parameters"]>) => (self: S) => S["Rebuild"]
Since v4.0.0