-
-
Notifications
You must be signed in to change notification settings - Fork 882
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
Make ajv chainable #625
Comments
Looks good. And drop “add”? :) |
Also removeSchema and removeKeyword can be chained, although they aren’t used too often. |
According to issue ajv-validator#625 this enables crazy things like `new Ajv().addSchema(mySchema).validate(schema, data)`
I am now thinking whether renaming all methods (maybe leaving old names as aliases) is a good idea: addSchema -> schema |
I am fine with the current naming prefix |
in 5.5.0 |
cool, thx for merging |
Forgive me if I've misunderstood the implementation of this, but it seems that addSchema is not chainable if an array of schemas is submitted. I made a quick pull-request: #640. |
You are right, i forgot the |
Thank you for providing this great and awesome library.
I would like to ask for the following improvement.
What do you think about making some ajv method returning
this
, that would allow to write more compact code by chaining methods. For example the following code would be possible:As far as i can see candidates for chaining would be
addSchema
,addMetaSchema
,addFormat
,addKeyword
.The text was updated successfully, but these errors were encountered: