Comments (3)
To resolve this for now I would suggest adding a casting
export const orderSchema = z.object({
'id': z.number().optional(),
'petId': z.number().optional(),
'quantity': z.number().optional(),
'shipDate': z.date().optional(),
'status': z.enum([`placed`, `approved`, `delivered`]).describe(`Order Status`).optional(),
'http_status': z.union([z.literal(200), z.literal(400)]).describe(`HTTP Status`).optional(),
'complete': z.boolean().optional(),
}) as z.ZodType<Order>
from kubb.
To resolve this for now I would suggest adding a casting
do you mean manually?
from kubb.
@chiptus No no, the casting will be added by Kubb so you don't need to care about it. The only thing here is that Kubb then will use casting which is of course not great but as a temporary solution I think that would be fine(so you can at least continue).
from kubb.
Related Issues (20)
- Zod: Recursive schema HOT 5
- ZodGenerator ignores minLength and maxLength for string properties
- Zod: root object should not be marked as `.optional()` in case of response HOT 2
- TanstackQuery: Infinite query page parameter is not always a number HOT 3
- Unplugin Kubb for vite/webpack/esbuild
- zod docs is missing section break
- use es2015 module syntax instead of ts namespace HOT 1
- allow to use unknown instead of any
- a main barrel export is created even when the config is disabled HOT 1
- refs with `.` inside, won't be imported correctly to zod schemas HOT 2
- still have some places with namespaces HOT 1
- [cli]: Dynamic require of "path" is not supported HOT 3
- Add override option to swagger-faker HOT 4
- minItems and maxItems for arrays are no longer included in zod schema
- Allow to add some unique value to queryKey template for a particular service/domain at the beginning of an array HOT 2
- Add Response access to SDK generated (server/client) HOT 2
- type error in the code by swagger-tanstack-query HOT 1
- Zod schema generated based on OpenAPI containing `anyOf` keyword doesn't work correctly - consider using `.strict` on every schema passed to `z.union` HOT 3
- AllOf not being generated properly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kubb.