[Feature Request] Load JSONSchema
Feature Request: Load JSONSchema
Problem Statement
While Zod has toJSONSchema, it has no (obvious) way to import an existing JSON Schema.
Proposed Solution
Add a fromJSONSchema(string) method that returns a Zod schema.
I'll appreciate supporting this feature as well, since json-schema-to-zod is going to be deprecated soon, a native solution would be appreciated.
I do realize this is significantly more complex than toJSONSchema; however I feel it would help adoption from users of Ajv and other libraries.
I've been playing a bit with the experimental api fromJSONSchema: https://zod.dev/json-schema?id=zfromjsonschema, it works well so far as a drop in replacement for json-schema-to-zod
One thing missing though would be the ability to do codegen and be able to write the zod type to a generated file - any chance this is planned or doable in the current state ?