Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this package compatible with @types/json-schema? #144

Open
dinfer opened this issue Sep 18, 2024 · 1 comment
Open

Is this package compatible with @types/json-schema? #144

dinfer opened this issue Sep 18, 2024 · 1 comment
Labels

Comments

@dinfer
Copy link

dinfer commented Sep 18, 2024

Error in typescript lint. the definitions field is imcompatible.
Is there any plan to support @types/json-schema in type ?

import type { JSONSchema7 } from "json-schema"
import { zodToJsonSchema } from "zod-to-json-schema"
const schema: JSONSchema7 = { ... }
const validator = zodToJsonSchema(schema) // error
image
@StefanTerdell
Copy link
Owner

Unfortunately not. This will be addressed in v4 if I end up making it. It's safe to cast though - the data structure itself is compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants