We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Hi, I'm using ajvResolver in my project but face a typescript error that is wrong.
here is my packages:
"@hookform/resolvers": "3.3.4", "react-hook-form": "^7.0.0", "typescript": "~5.2.2", "vite": "^5.0.0", "@types/react": "^18.2.46", "@types/react-dom": "^18.2.18",
and this is an example of code that I used:
const schema = { type: 'object', properties: { password1: { type: 'string', minLength: 3, errorMessage: { minLength: 'password1 field is required' }, }, password2: { type: 'string', minLength: 3, errorMessage: { minLength: 'password2 field is required' }, }, }, required: ['password1', 'password2'], additionalProperties: false, }; const validation = ajvResolver(schema);
but I face this error from ajvResolver:
ajvResolver
Property 'oneOf' is missing in type '{ type: string; properties: { password1: { type: string; minLength: number; errorMessage: { minLength: string; }; }; password2: { type: string; minLength: number; errorMessage: { minLength: string; }; }; }; required: string[]; additionalProperties: boolean; }' but required in type '{ oneOf: readonly UncheckedJSONSchemaType<FormType, false>[]; }'.ts(2345)
so when I add oneOf property the type problem will be solved but as I understand and test in AJV directly ,this property is not required !
oneOf
AJV
The text was updated successfully, but these errors were encountered:
also getting this issue
Sorry, something went wrong.
Can you try assigning the type JSONSchemaType to your schema as mentioned here. It solved the issue for me.
JSONSchemaType
Can you please provide a minimal reproducible example (e.g. a Codesandbox)?
No branches or pull requests
Describe the bug
Hi,
I'm using ajvResolver in my project but face a typescript error that is wrong.
here is my packages:
and this is an example of code that I used:
but I face this error from
ajvResolver
:Property 'oneOf' is missing in type '{ type: string; properties: { password1: { type: string; minLength: number; errorMessage: { minLength: string; }; }; password2: { type: string; minLength: number; errorMessage: { minLength: string; }; }; }; required: string[]; additionalProperties: boolean; }' but required in type '{ oneOf: readonly UncheckedJSONSchemaType<FormType, false>[]; }'.ts(2345)
so when I add
oneOf
property the type problem will be solved but as I understand and test inAJV
directly ,this property is not required !The text was updated successfully, but these errors were encountered: