github Effect-TS/effect @effect/schema@0.71.0

latest releases: @effect/sql-sqlite-bun@0.12.7, @effect/typeclass@0.27.3, @effect/sql-sqlite-react-native@0.14.6...
one month ago

Minor Changes

  • #3433 c1987e2 Thanks @gcanti! - Make json schema output more compatible with Open AI structured output, closes #3432.

    JSONSchema

    • remove oneOf in favour of anyOf (e.g. in JsonSchema7object, JsonSchema7empty, JsonSchema7Enums)
    • remove const in favour of enum (e.g. in JsonSchema7Enums)
    • remove JsonSchema7Const type
    • remove JsonSchema7OneOf type

    AST

    • remove identifier annotation from Schema.Null
    • remove identifier annotation from Schema.Object

Patch Changes

  • #3448 1ceed14 Thanks @tim-smart! - add Schema.ArrayEnsure & Schema.NonEmptyArrayEnsure

    These schemas can be used to ensure that a value is an array, from a value that may be an array or a single value.

    import { Schema } from "@effect/schema";
    
    const schema = Schema.ArrayEnsure(Schema.String);
    
    Schema.decodeUnknownSync(schema)("hello");
    // => ["hello"]
    
    Schema.decodeUnknownSync(schema)(["a", "b", "c"]);
    // => ["a", "b", "c"]
  • #3450 0e42a8f Thanks @tim-smart! - update dependencies

  • Updated dependencies [8295281, c940df6, 00b6c6d, f8d95a6]:

    • effect@3.6.4

Don't miss a new effect release

NewReleases is sending notifications on new releases.