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

Patch Changes

  • #4111 22905cf Thanks @gcanti! - JSONSchema: merge refinement fragments instead of just overwriting them.

    Before

    import { JSONSchema, Schema } from "effect"
    
    export const schema = Schema.String.pipe(
      Schema.startsWith("a"), // <= overwritten!
      Schema.endsWith("c")
    )
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "string",
      "description": "a string ending with \"c\"",
      "pattern": "^.*c$" // <= overwritten!
    }
    */

    After

    import { JSONSchema, Schema } from "effect"
    
    export const schema = Schema.String.pipe(
      Schema.startsWith("a"), // <= preserved!
      Schema.endsWith("c")
    )
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "type": "string",
      "description": "a string ending with \"c\"",
      "pattern": "^.*c$",
      "allOf": [
        {
          "pattern": "^a" // <= preserved!
        }
      ],
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
    */
  • #4019 9f5a6f7 Thanks @gcanti! - OpenApiJsonSchema: Use the experimental JSONSchema.fromAST API for implementation.

  • Updated dependencies [9f5a6f7, 22905cf, 9f5a6f7, 1e59e4f, 8d914e5, 03bb00f, 9f5a6f7, 14e1149, 9f5a6f7, 9f5a6f7]:

    • effect@3.11.5

Don't miss a new effect release

NewReleases is sending notifications on new releases.