#29973b15e1b Thanks @gcanti! - Improve error handling (type-level) for improper usage of optional, closes #2995
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.
#29943a750b2 Thanks @gcanti! - Expose exact option for strict decoding on missing properties, closes #2993
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.
#2955d79ca17 Thanks @gcanti! - The minItems filter now checks for an invalid argument (n < 1) and, when valid, refines the type to NonEmptyReadonlyArray<A>.
#29973b15e1b Thanks @gcanti! - Improve error handling (type-level) for improper usage of optional, closes #2995
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.
#29943a750b2 Thanks @gcanti! - Expose exact option for strict decoding on missing properties, closes #2993
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.
Bumps the production-dependencies group with 7 updates in the / directory:
0.36.40
0.36.46
0.55.5
0.57.2
0.51.5
0.51.11
0.33.24
0.33.29
0.33.24
0.33.29
0.67.18
0.67.24
3.2.8
3.3.3
Updates
@effect/cli
from 0.36.40 to 0.36.46Release notes
Sourced from
@effect/cli
's releases.Changelog
Sourced from
@effect/cli
's changelog.... (truncated)
Commits
368d735
Version Packages (#2996)50fc289
Version Packages (#2973)ca78f58
Version Packages (#2949)856024c
Version Packages (#2936)67f160a
IntroduceRedacted\<T>
module (#2856)8bc3822
Version Packages (#2928)61e8edb
fix print to stdout of cli (#1812) (#2920)ae55d07
Version Packages (#2911)Updates
@effect/platform
from 0.55.5 to 0.57.2Release notes
Sourced from
@effect/platform
's releases.Changelog
Sourced from
@effect/platform
's changelog.... (truncated)
Commits
368d735
Version Packages (#2996)50fc289
Version Packages (#2973)07e12ec
refactor Socket to use do notation (#2988)b38d456
Typo in Example Source Code in README.md (#2983)ca78f58
Version Packages (#2949)4d3fbe8
fix KeyValueStore for react native by making constructors lazy (#2966)856024c
Version Packages (#2936)188f0a5
parse URL instances when creating client requests (#2924)2b9ddfc
support new Pool options in /platform WorkerPool (#2876)67f160a
IntroduceRedacted\<T>
module (#2856)Updates
@effect/platform-node
from 0.51.5 to 0.51.11Release notes
Sourced from
@effect/platform-node
's releases.Changelog
Sourced from
@effect/platform-node
's changelog.... (truncated)
Commits
368d735
Version Packages (#2996)50fc289
Version Packages (#2973)ca78f58
Version Packages (#2949)856024c
Version Packages (#2936)188f0a5
parse URL instances when creating client requests (#2924)8bc3822
Version Packages (#2928)ae55d07
Version Packages (#2911)Updates
@effect/printer
from 0.33.24 to 0.33.29Release notes
Sourced from
@effect/printer
's releases.Changelog
Sourced from
@effect/printer
's changelog.Commits
368d735
Version Packages (#2996)50fc289
Version Packages (#2973)ca78f58
Version Packages (#2949)856024c
Version Packages (#2936)ae55d07
Version Packages (#2911)Updates
@effect/printer-ansi
from 0.33.24 to 0.33.29Release notes
Sourced from
@effect/printer-ansi
's releases.Changelog
Sourced from
@effect/printer-ansi
's changelog.Commits
368d735
Version Packages (#2996)50fc289
Version Packages (#2973)ca78f58
Version Packages (#2949)856024c
Version Packages (#2936)ae55d07
Version Packages (#2911)Updates
@effect/schema
from 0.67.18 to 0.67.24Release notes
Sourced from
@effect/schema
's releases.... (truncated)
Changelog
Sourced from
@effect/schema
's changelog.