Patch Changes
-
#3842
2367708
Thanks @gcanti! - add support forSchema.OptionFromUndefinedOr
in JSON Schema generation, closes #3839Before
import { JSONSchema, Schema } from "effect" const schema = Schema.Struct({ a: Schema.OptionFromUndefinedOr(Schema.Number) }) console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* throws: Error: Missing annotation at path: ["a"] details: Generating a JSON Schema for this schema requires a "jsonSchema" annotation schema (UndefinedKeyword): undefined */
After
import { JSONSchema, Schema } from "effect" const schema = Schema.Struct({ a: Schema.OptionFromUndefinedOr(Schema.Number) }) console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* Output: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "required": [], "properties": { "a": { "type": "number" } }, "additionalProperties": false } */
-
Updated dependencies [
2367708
]:- effect@3.10.4