Hyperlinkv0.8.0-beta.28

SchemaAST

SchemaAST.resolveconsteffect/SchemaAST.ts:3802
(ast: AST): Schema.Annotations.Annotations | undefined

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"
export const resolve: (ast: AST) => Schema.Annotations.Annotations | undefined = InternalAnnotations.resolve