Commit deed51a
fix: recurse into NullableSchema.inner in assertValidSchema
assertValidSchema validated array items, record values, and object
property schemas but skipped the inner schema of NullableSchema. A
misconfigured nested schema like s.nullable(s.object({ x: 'bad' as any }))
would silently escape the early construction-time check and only surface
a confusing error at invocation time or, worse, produce a repair loop.
This adds a nullable branch that recurses into schema.inner before the
properties branch, making schema validation consistent for all composite
schema types.
Discovered while running sample 13-test-plan.ts: the sample uses
s.nullable indirectly through s.object with enum fields, and analysing
assertValidSchema revealed the gap.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 6de6afb commit deed51a
2 files changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1687 | 1687 | | |
1688 | 1688 | | |
1689 | 1689 | | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
1690 | 1694 | | |
1691 | 1695 | | |
1692 | 1696 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
| |||
0 commit comments