Releases: Effect-TS/effect
Releases · Effect-TS/effect
@effect/[email protected]
Patch Changes
- Updated dependencies [
e4ba2c6
]:- [email protected]
- @effect/[email protected]
- @effect/[email protected]
- @effect/[email protected]
@effect/[email protected]
Patch Changes
- Updated dependencies [
37aa8e1
,34f03d6
]:- [email protected]
- @effect/[email protected]
- @effect/[email protected]
- @effect/[email protected]
@effect/[email protected]
Patch Changes
- Updated dependencies [
e4ba2c6
]:- [email protected]
- @effect/[email protected]
- @effect/[email protected]
- @effect/[email protected]
@effect/[email protected]
Patch Changes
- Updated dependencies [
37aa8e1
,34f03d6
]:- [email protected]
- @effect/[email protected]
- @effect/[email protected]
- @effect/[email protected]
[email protected]
Patch Changes
-
#4646
f87991b
Thanks @gcanti! - SchemaAST: add missinggetSchemaIdAnnotation
API -
#4646
f87991b
Thanks @gcanti! - Arbitrary: fix bug where annotations were ignored.Before
import { Arbitrary, Schema } from "effect" const schema = Schema.Int.annotations({ arbitrary: (_, ctx) => (fc) => { console.log("context: ", ctx) return fc.integer() } }).pipe(Schema.greaterThan(0), Schema.lessThan(10)) Arbitrary.make(schema) // No output ❌
After
import { Arbitrary, Schema } from "effect" const schema = Schema.Int.annotations({ arbitrary: (_, ctx) => (fc) => { console.log("context: ", ctx) return fc.integer() } }).pipe(Schema.greaterThan(0), Schema.lessThan(10)) Arbitrary.make(schema) /* context: { maxDepth: 2, constraints: { _tag: 'NumberConstraints', constraints: { min: 0, minExcluded: true, max: 10, maxExcluded: true }, isInteger: true } } */
-
#4648
0a3e3e1
Thanks @gcanti! - Schema:standardSchemaV1
now includes the schema, closes #4494.This update fixes an issue where passing
Schema.standardSchemaV1(...)
directly toJSONSchema.make
would throw aTypeError
. The schema was missing from the returned object, causing the JSON schema generation to fail.Now
standardSchemaV1
includes the schema itself, so it can be used withJSONSchema.make
without issues.Example
import { JSONSchema, Schema } from "effect" const Person = Schema.Struct({ name: Schema.optionalWith(Schema.NonEmptyString, { exact: true }) }) const standardSchema = Schema.standardSchemaV1(Person) console.log(JSONSchema.make(standardSchema)) /* { '$schema': 'http://json-schema.org/draft-07/schema#', '$defs': { NonEmptyString: { type: 'string', description: 'a non empty string', title: 'nonEmptyString', minLength: 1 } }, type: 'object', required: [], properties: { name: { '$ref': '#/$defs/NonEmptyString' } }, additionalProperties: false } */
@effect/[email protected]
@effect/[email protected]
@effect/[email protected]
Patch Changes
- Updated dependencies [
f87991b
,f87991b
,0a3e3e1
]:- [email protected]
- @effect/[email protected]
- @effect/[email protected]
@effect/[email protected]
Patch Changes
- Updated dependencies [
f87991b
,f87991b
,0a3e3e1
]:- [email protected]
- @effect/[email protected]
- @effect/[email protected]
@effect/[email protected]
Patch Changes
- Updated dependencies [
f87991b
,f87991b
,0a3e3e1
]:- [email protected]
- @effect/[email protected]
- @effect/[email protected]