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? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
If a callback function inputted to the validate property is self contained, then it could be used to generate the standalone code.
validate
Why not allow the client to specify a flag that would use the validate callback to generate standalone code?
ajv.addKeyword({ keyword: "even", type: "number", schemaType: "boolean", // $data: true // to support [$data reference](./guide/combining-schemas.md#data-reference), ... validate: (schema, data) => { return true; }, code(cxt) { const { data, schema } = cxt; const op = schema ? Ajv._`!==` : Ajv._`===`; cxt.fail(Ajv._`${data} %2 ${op} 0`); // ... the only code change needed is to use `cxt.fail$data` here }, });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If a callback function inputted to the
validate
property is self contained, then it could be used to generate the standalone code.Why not allow the client to specify a flag that would use the validate callback to generate standalone code?
The text was updated successfully, but these errors were encountered: