Skip to content

Adding extensions to AJV #63

@spasquali-ww

Description

@spasquali-ww

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions