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

Pass Ajv instance to Validator constructor #115

Open
pstadler opened this issue Jul 8, 2022 · 1 comment
Open

Pass Ajv instance to Validator constructor #115

pstadler opened this issue Jul 8, 2022 · 1 comment

Comments

@pstadler
Copy link

pstadler commented Jul 8, 2022

First of all, thank you for providing this middleware. I've been using it across multiple projects.

How about letting users pass an Ajv instance to Validator? In my case this would be an instance of the 2019-09 draft version[1].

const Ajv2019 = require('ajv/dist/2019')
const ajv = new Ajv2019()

const validator = new Validator(ajv)

[1] https://ajv.js.org/json-schema.html#draft-2019-09

Cheers
Patrick

@simonplend
Copy link
Owner

Glad to hear you're finding this package helpful!

That's a nice idea — if you're able to open a PR for this I'd be very happy to review it.

pstadler added a commit to pstadler/express-json-validator-middleware that referenced this issue Aug 12, 2022
pstadler added a commit to pstadler/express-json-validator-middleware that referenced this issue Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants