-
-
Notifications
You must be signed in to change notification settings - Fork 875
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
JTD schemas do not support coerceTypes option #1724
Comments
JTD schemas do not support type coercion. |
Why? |
@epoberezkin, |
Ran into the same issue today. Really happy with JTD type generation, but working against an inconsistent API makes coercion kind of a hassle. I wrote a small helper to wrap Ajv validator and do simple coercion. It's not extensively tested, but I'll update it if I run into bugs until this is an official feature: https://gist.github.com/fabianeichinger/f9bad3ee17d637ac3778448d0fb0f528 |
I'm using TypeScript v4.3.4 and I am unable to use the
coerceTypes
option when constructing the Ajv instance.This is a screenshot of the error I get in VSCodium v1.57.1:
The text was updated successfully, but these errors were encountered: