Skip to content

Commit

Permalink
chore(package): Updated @effect/schema to 0.67.24
Browse files Browse the repository at this point in the history
Patch Changes

This commit addresses concerns raised by users about the confusing behavior when 'optional' is misused in a schema definition. Previously, users experienced unexpected results, such as a schema returning 'Schema.All' when 'optional' was used incorrectly, without clear guidance on the correct usage or error messages.

Changes:

Enhanced the 'optional' method to return a descriptive type-level error when used incorrectly, helping users identify and correct their schema definitions.
Updated the Schema.optional() implementation to check its context within a pipeline and ensure it is being used correctly.
Added unit tests to verify that the new error handling works as expected and to ensure that correct usage does not affect existing functionality.

This commit addresses an issue where users encountered unexpected decoding behaviors, specifically regarding how undefined values and missing properties are handled. The default behavior of the @effect/schema library treats missing properties as undefined during decoding, which can lead to confusion when stricter validation is expected.

Changes:

Exposed an internal configuration option exțact (default: false), which when set to true, enforces strict decoding that will error on missing properties instead of treating them as undefined.
Updated documentation to clearly outline the default and strict decoding behaviors, providing users with guidance on how to enable strict validation.
Updated dependencies [06ede85, 7204ca5]:

[email protected]

Signed-off-by: Giovanni Ravalico <[email protected]>
  • Loading branch information
suddenlyGiovanni committed Sep 3, 2024
1 parent 1d61c52 commit bd1dd3d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@
},
"license": "UNLICENSED",
"peerDependencies": {
"@effect/schema": "~0.67.23"
"@effect/schema": "~0.67.24"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@changesets/cli": "2.27.7",
"@effect/schema": "0.67.23",
"@effect/schema": "0.67.24",
"@std/yaml": "npm:@jsr/[email protected]",
"@tsconfig/node21": "21.0.3",
"@tsconfig/strictest": "2.0.5",
"@types/json-schema": "7.0.15",
"@types/node": "22.5.2",
"@vitest/coverage-v8": "2.0.5",
"@vitest/ui": "2.0.5",
"effect": "3.3.2",
"effect": "3.3.3",
"typescript": "5.6.1-rc",
"vite-tsconfig-paths": "5.0.1",
"vitest": "2.0.5"
Expand Down
24 changes: 12 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bd1dd3d

Please sign in to comment.