master
Evgeny Poberezkin 2015-06-08 07:51:34 +01:00
parent 88e65a1800
commit 2de9b9e91e
1 changed files with 3 additions and 3 deletions

View File

@ -66,17 +66,17 @@ Create ajv instance.
##### .compile(Object schema) -> Function<Object data>
Generate validating function and cache compiled schema for future use.
Generate validating function and cache the compiled schema for future use.
##### .validate(Object schema|String key|String ref, data) -> Boolean
Validate data using passed schema (it will be compiled and cached).
Instead of the schema you can use the key that was previously passed to `addSchema` or a previously resolved reference.
Instead of the schema you can use the key that was previously passed to `addSchema`, the schema id if it was present in the schema or any previously resolved reference.
##### .addSchema(Array schemas|Object schema [, String key]) -> Function<Object data>
##### .addSchema(Array schemas|Object schema [, String key]) -> Function<Object data>|Array<Function<Object data>>
Add and compile schema(s). It does the same as `.compile` with two differences: