Patch Changes
-
#4138
cec0b4d
Thanks @gcanti! - JSONSchema: handle thenullable
keyword for OpenAPI target, closes #4075.Before
import { OpenApiJsonSchema } from "@effect/platform" import { Schema } from "effect" const schema = Schema.NullOr(Schema.String) console.log(JSON.stringify(OpenApiJsonSchema.make(schema), null, 2)) /* { "anyOf": [ { "type": "string" }, { "enum": [ null ] } ] } */
After
import { OpenApiJsonSchema } from "@effect/platform" import { Schema } from "effect" const schema = Schema.NullOr(Schema.String) console.log(JSON.stringify(OpenApiJsonSchema.make(schema), null, 2)) /* { "type": "string", "nullable": true } */
-
#4128
8d978c5
Thanks @gcanti! - JSONSchema: addtype
for homogeneous enum schemas, closes #4127Before
import { JSONSchema, Schema } from "effect" const schema = Schema.Literal("a", "b") console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "enum": [ "a", "b" ] } */
After
import { JSONSchema, Schema } from "effect" const schema = Schema.Literal("a", "b") console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "enum": [ "a", "b" ] } */
-
#4138
cec0b4d
Thanks @gcanti! - JSONSchema: use{ "type": "null" }
to represent thenull
literalBefore
import { JSONSchema, Schema } from "effect" const schema = Schema.NullOr(Schema.String) console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "anyOf": [ { "type": "string" }, { "enum": [ null ] } ] } */
After
import { JSONSchema, Schema } from "effect" const schema = Schema.NullOr(Schema.String) console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "anyOf": [ { "type": "string" }, { "type": "null" } ] } */
-
Updated dependencies [
2408616
,cec0b4d
,cec0b4d
,8d978c5
,cec0b4d
,cec0b4d
]:- effect@3.11.7