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

Adding extensions to AJV #63

Open
spasquali-ww opened this issue Oct 17, 2020 · 1 comment
Open

Adding extensions to AJV #63

spasquali-ww opened this issue Oct 17, 2020 · 1 comment

Comments

@spasquali-ww
Copy link

How do I extend ajv with custom packages, eg https://github.com/ajv-validator/ajv-keywords?

I don't see how I can grab the ajv instance to enable something like this:

require('ajv-keywords')(ajv);

ajv.validate({ instanceof: 'RegExp' }, /.*/); // true
ajv.validate({ instanceof: 'RegExp' }, '.*'); // false

It doesn't look like I can trigger this via the ajvConfigBody options for example.

Thanks!

@kobik
Copy link
Collaborator

kobik commented Dec 10, 2020

Have you tried using ajvConfigParams?

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

No branches or pull requests

2 participants