standardSchemaV1
standardSchemaV1<
A
,I
>(schema
,overrideOptions
?):StandardSchemaV1
<I
,A
> &SchemaClass
<A
,I
,never
>
Defined in: node_modules/.pnpm/effect@3.14.8/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
.
Type Parameters
• A
• I
Parameters
schema
Schema
<A
, I
, never
>
overrideOptions?
ParseOptions
Returns
StandardSchemaV1
<I
, A
> & SchemaClass
<A
, I
, never
>
Example
import { Schema } from "effect"
const schema = Schema.Struct({ name: Schema.String})
// ┌─── StandardSchemaV1<{ readonly name: string; }>// ▼const standardSchema = Schema.standardSchemaV1(schema)
Since
3.13.0