Patch Changes
-
#5617
6ae2f5d
Thanks @gcanti! - JSONSchema: Fix issue where invaliddefault
s were included in the output.Now they are ignored, similar to invalid
examples
.Before
import { JSONSchema, Schema } from "effect" const schema = Schema.NonEmptyString.annotations({ default: "" }) const jsonSchema = JSONSchema.make(schema) console.log(JSON.stringify(jsonSchema, null, 2)) /* Output: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "description": "a non empty string", "title": "nonEmptyString", "default": "", "minLength": 1 } */
After
import { JSONSchema, Schema } from "effect" const schema = Schema.NonEmptyString.annotations({ default: "" }) const jsonSchema = JSONSchema.make(schema) console.log(JSON.stringify(jsonSchema, null, 2)) /* Output: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "description": "a non empty string", "title": "nonEmptyString", "minLength": 1 } */