Merge commit '36c66dd290d3ce6eb1ccd310d0c658d4a32bb8eb' as 'repos/effect'
This commit is contained in:
7
repos/effect/.changeset/schema-defaults-issue-channel.md
Normal file
7
repos/effect/.changeset/schema-defaults-issue-channel.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"effect": patch
|
||||
---
|
||||
|
||||
Allow Schema constructor and decoding defaults to fail with `SchemaError`.
|
||||
|
||||
The `Effect` passed to `Schema.withConstructorDefault`, `Schema.withDecodingDefault`, `Schema.withDecodingDefaultKey`, `Schema.withDecodingDefaultType`, and `Schema.withDecodingDefaultTypeKey` now accepts `SchemaError` in its error channel. When a default fails, the parser unwraps the underlying `SchemaIssue.Issue` and propagates it as a parse failure with the surrounding path attached. This makes it easy to use another schema's `makeEffect` / `decode*` as the default value.
|
||||
Reference in New Issue
Block a user