github Effect-TS/effect @effect/platform@0.66.2

latest releases: @effect/sql-sqlite-wasm@0.13.0, @effect/sql-sqlite-react-native@0.16.0, @effect/sql-sqlite-node@0.14.0...
one day ago

Patch Changes

  • #3667 fd83d0e Thanks @gcanti! - Remove default json schema annotations from string, number and boolean.

    Before

    import { JSONSchema, Schema } from "@effect/schema"
    
    const schema = Schema.String.annotations({ examples: ["a", "b"] })
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "string",
      "description": "a string",
      "title": "string",
      "examples": [
        "a",
        "b"
      ]
    }
    */

    After

    import { JSONSchema, Schema } from "@effect/schema"
    
    const schema = Schema.String.annotations({ examples: ["a", "b"] })
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "string",
      "examples": [
        "a",
        "b"
      ]
    }
    */
  • #3672 090e41c Thanks @gcanti! - JSON Schema: handle refinements where the 'from' part includes a transformation, closes #3662

    Before

    import { JSONSchema, Schema } from "@effect/schema"
    
    const schema = Schema.Date
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    throws
    Error: Missing annotation
    details: Generating a JSON Schema for this schema requires a "jsonSchema" annotation
    schema (Refinement): Date
    */

    After

    import { JSONSchema, Schema } from "@effect/schema"
    
    const schema = Schema.Date
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "string",
      "description": "a string that will be parsed into a Date"
    }
    */
  • Updated dependencies [734eae6, fd83d0e, 4509656, ad7e1de, 090e41c, 090e41c]:

    • @effect/schema@0.74.1
    • effect@3.8.4

Don't miss a new effect release

NewReleases is sending notifications on new releases.