form icon indicating copy to clipboard operation
form copied to clipboard

docs(form): Effect Schema also supports Standard Schema

Open rehos opened this issue 10 months ago • 0 comments

Effect Schema also supports Standard Schema.

The StackBlitz example can also be modified with:

import { Schema as S } from 'effect';

const EffectSchema = S.standardSchemaV1(
  S.Struct({
    firstName: S.String.pipe(
      S.minLength(3),
      S.annotations({
        message: () => '[Effect/Schema] You must have a length of at least 3',
      })
    ),
    lastName: S.String.pipe(
      S.minLength(3),
      S.annotations({
        message: () => '[Effect/Schema] You must have a length of at least 3',
      })
    ),
  })
);

See it live

rehos avatar Mar 09 '25 12:03 rehos