effect
4.1.4 · 11 Nov 2026MIT66.6M / weekRepositoryHomepagenpmAtom feed
3.22.5 is the newest release of 3.x.
In short
1 fixed
Security
2 advisories affect 3.18.3; 3.22.1 fixes them
- HighEffect: ReDoS in Schema.TemplateLiteral compiled regexGHSA-7589-6fvf-x4pw · 19 Nov 2026Fixed in 3.22.1
- HighEffect `AsyncLocalStorage` context lost/contaminated inside Effect fibers under concurrent load with RPCGHSA-38f7-945m-qr2g · 20 Mar 2026Fixed in 3.20.0
Release note
Patch Changes
Fix JSON Schema generation with
topLevelReferenceStrategy: "skip", closes #5611This patch fixes a bug that occurred when generating JSON Schemas with nested schemas that had identifiers, while using
topLevelReferenceStrategy: "skip".Previously, the generator would still output
$refentries even though references were supposed to be skipped, leaving unresolved definitions.Before
import { JSONSchema, Schema } from "effect" const A = Schema.Struct({ value: Schema.String }).annotations({ identifier: "A" }) const B = Schema.Struct({ a: A }).annotations({ identifier: "B" }) const definitions = {} console.log( JSON.stringify( JSONSchema.fromAST(B.ast, { definitions, topLevelReferenceStrategy: "skip" }), null, 2 ) ) /* { "type": "object", "required": ["a"], "properties": { "a": { "$ref": "#/$defs/A" } }, "additionalProperties": false } */ console.log(definitions) /* { A: { type: "object", required: ["value"], properties: { value: [Object] }, additionalProperties: false } } */After
import { JSONSchema, Schema } from "effect" const A = Schema.Struct({ value: Schema.String }).annotations({ identifier: "A" }) const B = Schema.Struct({ a: A }).annotations({ identifier: "B" }) const definitions = {} console.log( JSON.stringify( JSONSchema.fromAST(B.ast, { definitions, topLevelReferenceStrategy: "skip" }), null, 2 ) ) /* { "type": "object", "required": ["a"], "properties": { "a": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false } */ console.log(definitions) /* {} */Now schemas are correctly inlined, and no leftover
$refentries or unused definitions remain.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.