Comments (4)
I have a very similar issue with "zod": "^3.23.8"
. regardless of the types i'm using in my schema, it is generating each field as optional (even if i don't say .optional()
).
from zod.
I have similar issue here too.
from zod.
Have excatly the same problem. Any solutions or ways how to avoid this?
from zod.
We are seeing this too. We have figured this out though. We are using a monorepo but the below should be useful to anyone.
If one of your fields in your schema has an issue all the fields will show as type "unknown". So strip your schemas down to one field that is simply 'z.string()' and see if that works, then build your schema back up to see where the issue is.
If you are using aliases to import files and you have configured your tsconfig.json like the below you will have an issue when importing your types into another project other projects do not know how to resolve those alias pathways.
{
"compilerOptions": {
"paths": {
"address/*": ["src/packages/address/*"],
"database/*": ["src/packages/database/*"],
"link/*": ["src/packages/link/*"],
"media/*": ["src/packages/media/*"],
"notification/*": ["src/packages/notification/*"],
},
},
}
The fix we have done is to not use alias pathways for our schemas. Possibly there might be some config setting to fix how your other projects resolve alias pathways but I dont have time to figure that out.
from zod.
Related Issues (20)
- Module '"zod"' has no exported member 'z'.ts HOT 14
- Add nonempty() method to zod.record() for empty object validation
- parsed data is becoming never HOT 10
- Idea: `.meta(...)` method on ZodType HOT 1
- How to union or merge two or more z.record schemas HOT 1
- Type narrowing not working with generic zod type HOT 1
- Allow `.extract`/`.exclude` for `nativeEnum`s
- Update repo link `zod-accelerator` in readme.
- feat: Adding json Schema to the package
- Question: TypeScript Isolated Declarations
- Problem with validation of identical fields in the schema HOT 4
- Although `z.string().date()` check fails, yet the callback to `.superRefine()` is executed.
- Bug: .safeParse() should not throw
- values of type number are not accepted when key of NativeEnum is specified as a number type HOT 3
- The mapped-type is not recursive in `ZodFormattedError` (`error.format()`)
- Access, manipulate, and throw error from `z.catch` HOT 3
- Bug: z.output makes all properties optional HOT 2
- Proposal : make `coerce` more generic
- feat: `strict` option for transforming overflow properties to value
- No index signature with a parameter of type 'string' was found on type with union of array and key-ed object HOT 2
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 zod.