effect-io-ai

Package: effect
Module: SchemaAST

SchemaAST.resolve

Returns all annotations from the AST node.

Details

If the node has Checks, returns annotations from the last check (which is where user-supplied annotations end up after .pipe(Schema.annotations(...))). Otherwise returns Base.annotations directly.

Example (Reading annotations)

import { Schema, SchemaAST } from "effect"

const schema = Schema.String.annotate({ title: "Name" })
const annotations = SchemaAST.resolve(schema.ast)
console.log(annotations?.title) // "Name"

See

Signature

declare const resolve: (ast: AST) => Schema.Annotations.Annotations | undefined

Source

Since v4.0.0