frontend: add zod plugin to hey-api openapi-ts

Generate Zod schemas alongside the typed client (src/client/zod.gen.ts),
picking up the OpenAPI field defaults. Enables runtime validation and
default-filling for form payloads.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-19 07:24:52 +02:00
co-authored by Claude Opus 4.8
parent 5d8e33d52c
commit 9fc971c1d2
4 changed files with 1228 additions and 2 deletions
+1
View File
@@ -14,5 +14,6 @@ export default defineConfig({
},
'@hey-api/sdk',
'@tanstack/react-query',
'zod',
],
});
+11 -1
View File
@@ -28,7 +28,8 @@
"typescript": "^5.9.3",
"vite": "^7.3.1",
"vite-plugin-svgr": "^4.5.0",
"vite-tsconfig-paths": "^6.1.1"
"vite-tsconfig-paths": "^6.1.1",
"zod": "^4.4.3"
},
"devDependencies": {
"@hey-api/openapi-ts": "^0.98.2",
@@ -9795,6 +9796,15 @@
"engines": {
"node": ">=10"
}
},
"node_modules/zod": {
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz",
"integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}
}
}
}
+2 -1
View File
@@ -25,7 +25,8 @@
"typescript": "^5.9.3",
"vite": "^7.3.1",
"vite-plugin-svgr": "^4.5.0",
"vite-tsconfig-paths": "^6.1.1"
"vite-tsconfig-paths": "^6.1.1",
"zod": "^4.4.3"
},
"scripts": {
"start": "vite",
File diff suppressed because it is too large Load Diff