Patch Changes
-
#3669
734eae6
Thanks @gcanti! - Add description annotation to the encoded part of NumberFromString.Before
import { JSONSchema, Schema } from "@effect/schema" const schema = Schema.NumberFromString console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "type": "string" } */
After
import { JSONSchema, Schema } from "@effect/schema" const schema = Schema.NumberFromString console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "description": "a string that will be parsed into a number" } */
-
#3667
fd83d0e
Thanks @gcanti! - Remove default json schema annotations from string, number and boolean.Before
import { JSONSchema, Schema } from "@effect/schema" const schema = Schema.String.annotations({ examples: ["a", "b"] }) console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "description": "a string", "title": "string", "examples": [ "a", "b" ] } */
After
import { JSONSchema, Schema } from "@effect/schema" const schema = Schema.String.annotations({ examples: ["a", "b"] }) console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "examples": [ "a", "b" ] } */
-
#3673
ad7e1de
Thanks @gcanti! - Add more description annotations. -
#3672
090e41c
Thanks @gcanti! - JSON Schema: handle refinements where the 'from' part includes a transformation, closes #3662Before
import { JSONSchema, Schema } from "@effect/schema" const schema = Schema.Date console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* throws Error: Missing annotation details: Generating a JSON Schema for this schema requires a "jsonSchema" annotation schema (Refinement): Date */
After
import { JSONSchema, Schema } from "@effect/schema" const schema = Schema.Date console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "description": "a string that will be parsed into a Date" } */
-
#3672
090e41c
Thanks @gcanti! - Add description annotation to the encoded part of DateFromString.Before
import { JSONSchema, Schema } from "@effect/schema" const schema = Schema.DateFromString console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "type": "string" } */
After
import { JSONSchema, Schema } from "@effect/schema" const schema = Schema.DateFromString console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "description": "a string that will be parsed into a Date" } */
-
Updated dependencies [
4509656
]:- effect@3.8.4