Skip to content

standardSchemaV1

const standardSchemaV1: <A, I>(schema, overrideOptions?) => StandardSchemaV1<I, A> & SchemaClass<A, I, never>

Defined in: node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/dts/Schema.d.ts:124

Returns a “Standard Schema” object conforming to the Standard Schema v1 specification.

This function creates a schema whose validate method attempts to decode and validate the provided input synchronously. If the underlying Schema includes any asynchronous components (e.g., asynchronous message resolutions or checks), then validation will necessarily return a Promise instead.

Any detected defects will be reported via a single issue containing no path.

A

I

Schema<A, I, never>

AST.ParseOptions

StandardSchemaV1<I, A> & SchemaClass<A, I, never>

import { Schema } from "effect"
const schema = Schema.Struct({
name: Schema.String
})
// ┌─── StandardSchemaV1<{ readonly name: string; }>
// ▼
const standardSchema = Schema.standardSchemaV1(schema)

3.13.0