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:
@@ -14,5 +14,6 @@ export default defineConfig({
|
||||
},
|
||||
'@hey-api/sdk',
|
||||
'@tanstack/react-query',
|
||||
'zod',
|
||||
],
|
||||
});
|
||||
|
||||
Generated
+11
-1
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user