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

Add keywords option #1136

Closed
franciscomorais opened this issue Dec 18, 2019 · 1 comment
Closed

Add keywords option #1136

franciscomorais opened this issue Dec 18, 2019 · 1 comment

Comments

@franciscomorais
Copy link
Contributor

Add the keywords option to the Ajv options to add custom keywords, without having to call addKeyword.

What version of Ajv you are you using?
6.10.2

What problem do you want to solve?
Add keywords object directly to the Ajv constructor, like formats.

new Ajv({
  keywords: {
    constant: {
      validate: function (schema, data) {
        return true;
      }
    }
  }
});

What do you think is the correct solution to problem?
Copy the implementation of the formats option to add keywords.

Will you be able to implement it?
yes

@epoberezkin
Copy link
Member

merged

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

No branches or pull requests

2 participants