Commit e5b1274
fix: widen elicitInput requestedSchema type to accept Zod's toJSONSchema output
Zod v4's `.toJSONSchema()` produces standard JSON Schema output that includes
fields like `$schema` and `additionalProperties`. The `requestedSchema` type
in `ElicitRequestFormParams` was too narrow to accept these extra fields,
forcing users to cast through `unknown`.
This adds `.passthrough()` to the Zod runtime schema and an index signature
to the spec type, allowing any additional JSON Schema fields through while
keeping the required fields (`type`, `properties`) strictly typed.
Fixes #1362
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent ccb78f2 commit e5b1274
3 files changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2795 | 2795 | | |
2796 | 2796 | | |
2797 | 2797 | | |
| 2798 | + | |
2798 | 2799 | | |
2799 | 2800 | | |
2800 | 2801 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2024 | 2024 | | |
2025 | 2025 | | |
2026 | 2026 | | |
2027 | | - | |
2028 | | - | |
2029 | | - | |
2030 | | - | |
2031 | | - | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
2032 | 2034 | | |
2033 | 2035 | | |
2034 | 2036 | | |
| |||
0 commit comments