-
-
Notifications
You must be signed in to change notification settings - Fork 877
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 to Ajv options #1137
Add keywords to Ajv options #1137
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment it adds formats, not keywords. The implementation, tests and types need to be updated.
0101e15
to
aa3123f
Compare
aa3123f
to
c5ac6ce
Compare
describe('keywords', function() { | ||
it('should add keywords from options', function() { | ||
var ajv = new Ajv({ keywords: { | ||
identifier: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest adding type: "string" in the keyword definition and changing the implementation to /^[a-z_$][a-z0-9_$]*$/i.test(data)
so the example makes sense. Then the same tests can be used as in formats option test.
c5ac6ce
to
38191c2
Compare
This PR adds the
keywords
option to the Ajv options to add custom keywords, without having to calladdKeyword
.What issue does this pull request resolve?
#1136
What changes did you make?
Add the keywords option to the Ajv options to add custom keywords, without having to call addKeyword.
Is there anything that requires more attention while reviewing?
No