You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@StefanTerdell the package name disinform everybody who's looking how to convert JSON to Zod. Programmatic example doesn't say anything about return type. What would somebody expect to get running the following code?
constschema=jsonSchemaToZod(myObject);
I would expect to return schema instead of a string. It would be fair to rename the project and update the example. Personally for me this confusion caused me to rethink completely what I was planning to do for 2 weeks and the fact that I noticed this issue just now costs me many hours of my time because I was naively relying on the part of the documentation that clearly describes programmatic use. Please, respect people who's going to use your thing.
I've reviewed other posts on the same issue, but am unable to convert / eval the string zod schema.
const zod_schema = eval(parseSchema(schema)) ;
results inReferenceError: z is not defined
I also tried:This resulted in the same error.
const zod_schema = eval(jsonSchemaToZod(schema)) ;
results inSyntaxError: Cannot use import statement outside a module
The text was updated successfully, but these errors were encountered: