Patch Changes
-
#3117
cb76bcb
Thanks @gcanti! - ModifiedJSONSchema.make
to selectively ignore thetitle
anddescription
fields in schema types such asSchema.String
,Schema.Number
, andSchema.Boolean
, closes #3116Before
import { JSONSchema, Schema as S } from "@effect/schema"; const schema = S.Struct({ foo: S.String, bar: S.Number, }); console.log(JSONSchema.make(schema)); /* { '$schema': 'http://json-schema.org/draft-07/schema#', type: 'object', required: [ 'foo', 'bar' ], properties: { foo: { type: 'string', description: 'a string', title: 'string' }, bar: { type: 'number', description: 'a number', title: 'number' } }, additionalProperties: false } */
Now
import { JSONSchema, Schema as S } from "@effect/schema"; const schema = S.Struct({ foo: S.String, bar: S.Number, }); console.log(JSONSchema.make(schema)); /* { '$schema': 'http://json-schema.org/draft-07/schema#', type: 'object', required: [ 'foo', 'bar' ], properties: { foo: { type: 'string' }, bar: { type: 'number' } }, additionalProperties: false } */