Commit f734677
fix(rest): ingress parse failures speak the documented fields[] envelope
The two new schema parses (#3897 / #3933) reported Zod failures as `issues[]`,
copying the cross-object batch route. But the data surface's documented
`VALIDATION_FAILED` envelope carries `fields[]` (`{field, code, message}` —
wire-format §7), which is also what `mapDataError` emits for a validator-thrown
one (#3918). Two shapes behind one wire code means a client keying on `fields`
silently sees nothing on these routes.
Adds `zodIssuesToFields` and uses it on both, so `code: 'VALIDATION_FAILED'`
means one thing on the data surface regardless of which layer noticed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TzLE9cw4gZKNyPN2ZP4iTt1 parent fccec22 commit f734677
3 files changed
Lines changed: 32 additions & 2 deletions
File tree
- packages/rest/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
135 | 140 | | |
136 | 141 | | |
137 | 142 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
112 | 118 | | |
113 | 119 | | |
114 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
79 | 98 | | |
80 | 99 | | |
81 | 100 | | |
| |||
6836 | 6855 | | |
6837 | 6856 | | |
6838 | 6857 | | |
| 6858 | + | |
6839 | 6859 | | |
6840 | | - | |
6841 | 6860 | | |
6842 | 6861 | | |
6843 | 6862 | | |
| |||
6897 | 6916 | | |
6898 | 6917 | | |
6899 | 6918 | | |
| 6919 | + | |
6900 | 6920 | | |
6901 | | - | |
6902 | 6921 | | |
6903 | 6922 | | |
6904 | 6923 | | |
| |||
0 commit comments