Commit b47c1fa
fix(orm): clear schemaCache before rebuilding registry in toJSONSchema
On a second call to toJSONSchema(), schemaRegistry.clear() emptied the
registry but @cache()-decorated builders returned their cached ZodType
without re-executing, so registerSchema() was never called and the
serialized registry was empty.
Fix by clearing schemaCache before schemaRegistry so all builders
re-execute on the subsequent eager calls and re-register their schemas.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent bb8b2b4 commit b47c1fa
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
205 | 209 | | |
206 | 210 | | |
207 | 211 | | |
| |||
0 commit comments