Type Error with `getDescriptionAnnotation` and `PropertySignature.AST` in Effect Schema
Hey guys, I am trying to do the following:
import { Schema, SchemaAST } from 'effect';const Foo = Schema.Struct({ foo: Schema.String.annotations({ description: 'A string field' }), bar: Schema.Number.pipe(Schema.optional).annotations({ description: 'An optional number field' }),})const descriptions = Object.values(Foo.fields).map(field => SchemaAST.getDescriptionAnnotation(field.ast));
import { Schema, SchemaAST } from 'effect';const Foo = Schema.Struct({ foo: Schema.String.annotations({ description: 'A string field' }), bar: Schema.Number.pipe(Schema.optional).annotations({ description: 'An optional number field' }),})const descriptions = Object.values(Foo.fields).map(field => SchemaAST.getDescriptionAnnotation(field.ast));
But I am getting a type error because
AST | PropertySignature.AST
AST | PropertySignature.AST
can't be assigned to the getDescriptionAnnotation function. This does not really surprise me, and I know this would be solved in Schema v4, but I have never really grokked Property Signatures.