Evgeny Poberezkin
de0c827dec
feat: throw exception if schema id is not a string and report error, closes #380
2017-02-04 22:36:21 +00:00
Evgeny Poberezkin
f5bcd5735a
fix: code clean-up, closes #388
2017-02-04 22:15:23 +00:00
Evgeny Poberezkin
ca6916385b
feat: throw exception if $schema is not a string, closes #394
2017-02-04 21:30:26 +00:00
Gajus Kuizinas
3588e453fa
docs: document a better regex variation
2017-01-25 22:51:55 +00:00
Gajus Kuizinas
452d2408af
fix: improve regex to pass all the tests
2017-01-25 22:51:33 +00:00
Gajus Kuizinas
8d232d2bb0
feat: add URL record format
2017-01-25 13:24:47 +00:00
Evgeny Poberezkin
254c2672d5
feat: format uri-template, #384
2017-01-23 22:08:05 +00:00
Evgeny Poberezkin
e949b8462c
test: patternGroups with meta; meta: false warns insead of throwing meta-schema validation
2017-01-23 20:16:38 +00:00
Evgeny Poberezkin
8892f98a4c
fix: patternGroups without draft-06 meta-schema
2017-01-23 19:58:02 +00:00
Evgeny Poberezkin
8bb3b52f55
feat: serialize option, closes #385 , closes #341
2017-01-21 20:28:50 +00:00
Evgeny Poberezkin
d4fb50bdbe
Merge branch 'master' into 5.0.0
2017-01-21 19:57:38 +00:00
Evgeny Poberezkin
ccc9907d26
feat: allow setting dataPath in validate/compile keywords, closes #331
2017-01-21 19:44:08 +00:00
Evgeny Poberezkin
f89a04de4c
docs: fixed custom keyword definition typing
2017-01-20 23:39:27 +00:00
Evgeny Poberezkin
a06327eab4
Merge branch 'master' into 5.0.0
2017-01-20 23:30:54 +00:00
Evgeny Poberezkin
7148ae3607
docs: update typings for "modifying" and "valid" custom keywords, #392 , #393
2017-01-20 23:25:45 +00:00
Evgeny Poberezkin
aa8de572df
feat: custom keywords with predefined validation result, #393
2017-01-20 23:08:52 +00:00
Evgeny Poberezkin
33845cc397
feat: support custom keywords that modify data, #392
2017-01-20 22:03:36 +00:00
Evgeny Poberezkin
2468bd5014
refactor: custom keyword code generation, #392
2017-01-20 21:33:34 +00:00
Evgeny Poberezkin
b2d641f244
feat: add schema id (URI) as a comment to generated code
2017-01-07 12:49:48 +00:00
Richard Taylor
b1b0c553d8
Improve implementation of allowing hyphens in keywords
...
This:
- Updates the README with the new rules (and recommendations)
- Updates `keyword.js` to implement the agreed change to the naming rules:
- - Now same as before but also allow hyphens as second and subsequent characters
- Update tests to test the new keyword naming rules
- Update `definitions.def` to use it.util.getProperty() to dynamically choose dot
or bracket notation as appropriate rather than hardcode bracket notation.
Test Plan:
- Run `npm test` and ensure all tests run and pass
2017-01-05 18:28:28 +00:00
Richard Taylor
66db560ca5
Allow custom keywords that are not valid JS identifiers
...
Custom keywords were required to be valid JS identifiers due to the
way they were being used in the generated code. This prevented the use
of keywords with the `x-` prefix that is required by [swagger](http://swagger.io ].
This change fixes that by updating the only place that was using them
directly as an identifier to use //brackets// notation rather than
//dot// notation. This brings the definition of `$schemaPath` in
`definitions.def` in line with the way the rule definition is accessed
from `RULES.custom` at the top of `custom.jst`.
The validation of the keyword name has been changed to allow any name
in this change, but this should be updated to either just remove the
test or update it to a new rule before this change is included in
the project.
Finally, this also updates a number of the tests in `custom.spec.js` to
use non-valid identifiers for the names of some of the custom keywords
being tested (primarily by adding `x-` to the front of the name).
Test Plan:
- Run `npm test` and ensure all tests run and pass
2017-01-05 10:48:12 +00:00
Evgeny Poberezkin
41ecdaff7c
refactor: contains implemented as a standard keyword, #367
2016-12-30 17:44:18 +00:00
Evgeny Poberezkin
cf3f1cea50
refactor: changed format "uriref" to "uri-ref", #367
2016-12-29 23:05:28 +00:00
Evgeny Poberezkin
19512861d2
feat: support numeric exclusiveMaximum/Minimum with $data, #367
2016-12-29 19:44:08 +00:00
Evgeny Poberezkin
4a9d765e5a
feat: support numeric exclusiveMaximum/Minimum (no $data support yet), #367
2016-12-28 23:08:25 +00:00
Evgeny Poberezkin
1c284933fc
feat: use co-wrapped generator function as default async option (async: co*), #383
2016-12-26 21:10:46 +00:00
Evgeny Poberezkin
6f2cea2244
refactor: support for transpile option moved to ajv-async package, #383
2016-12-26 20:57:14 +00:00
Evgeny Poberezkin
fc1c46cbfa
feat: option processCode replaced option beautify, closes #382
2016-12-26 16:57:06 +00:00
Evgeny Poberezkin
6036f3ff07
feat: update type definitions
...
allow boolean schemas
async validation promise resolves with data
properties of custom keyword definition ($data and metaSchema)
custom keyword schema can be any value
keyword schema in error object can be any value
optional propertyName property of error object for all keywords (added when validating schema in propertyNames)
propertyNames keyword error params
2016-12-25 21:39:36 +00:00
Evgeny Poberezkin
ad7ae50c51
refactor: move const keyword to rules (as standard keyword)
2016-12-25 20:42:54 +00:00
Evgeny Poberezkin
850b50523c
feat: async validation promise resolves with data in case of success, closes #377
2016-12-25 20:24:36 +00:00
Evgeny Poberezkin
f1028c8411
feat: support boolean schemas in $ref
2016-12-25 17:43:26 +00:00
Evgeny Poberezkin
225ef67ce5
refactor: omptimise/fix generated code
...
optimize code for schemas without validation keywords
fix bug in determining empty schema
2016-12-25 15:32:53 +00:00
Evgeny Poberezkin
71c3709c2a
refactor: validate.jst
2016-12-25 14:09:11 +00:00
Evgeny Poberezkin
393b6a5b35
refactor: optimise code generated for boolean schemas
2016-12-25 13:53:51 +00:00
Evgeny Poberezkin
a414a74fe0
Merge branch 'boolean-schemas' into 5.0.0
2016-12-25 13:33:37 +00:00
Evgeny Poberezkin
ac6097f285
Merge branch 'master' into 5.0.0
2016-12-25 00:22:01 +00:00
Evgeny Poberezkin
c4335abf53
fix: allOf with empty schemas failing compilation, fixes #381
2016-12-24 23:42:36 +00:00
Evgeny Poberezkin
484df70eb5
feat: support boolean schemas, #367
2016-12-24 23:04:07 +00:00
Evgeny Poberezkin
a6f9cbda0f
feat: boolean schemas
2016-12-24 21:23:31 +00:00
Evgeny Poberezkin
559efa2b49
feat: support dependencies keyword with empty array of required properties, #367
2016-12-24 16:21:34 +00:00
Evgeny Poberezkin
17de8aba47
fix: error macro
2016-12-24 02:23:12 +00:00
Evgeny Poberezkin
82775ee8de
feat: draft6 propertyName keyword (standard, inline)
2016-12-23 23:45:48 +00:00
Evgeny Poberezkin
d41d150ba3
Merge branch 'master' into 5.0.0
2016-12-23 22:18:36 +00:00
Evgeny Poberezkin
c02a3bdc48
refactor: clean up keyword templates
2016-12-23 22:02:41 +00:00
Evgeny Poberezkin
416f294350
Merge branch 'master' into 5.0.0
2016-12-23 19:47:01 +00:00
Evgeny Poberezkin
23f2572d1c
fix: formats json-pointer and relative-json-pointer now support empty fragments
2016-12-23 17:34:25 +00:00
Evgeny Poberezkin
9f487e2833
refactor: rename keyword "constant" to "const", #367
2016-12-21 21:50:10 +00:00
Evgeny Poberezkin
ab488a4f57
feat: option $data instead of v5, use draft-6 meta schema, support constant and contains keywords by default, #372
2016-12-21 21:11:59 +00:00
Evgeny Poberezkin
42d640779a
refactor: move patternGroups deprecation message to schema compilation, #371
2016-12-20 20:57:34 +00:00
Evgeny Poberezkin
73593ac04e
refactor: remove keywords moved to ajv-keywords from v5 meta-schema, #371
2016-12-20 20:48:11 +00:00
Evgeny Poberezkin
afd02f1f72
refactor: patternGroups deprecated, requires option to use, #371
2016-12-20 20:33:51 +00:00
Evgeny Poberezkin
d19bc92c8b
refactor: move format comparison functions to ajv-keywords, #371
2016-12-11 18:49:02 +00:00
Evgeny Poberezkin
05f2416893
feat: support custom keywords that have implementations for other keywords
2016-12-11 17:42:08 +00:00
Evgeny Poberezkin
a607d4f422
refactor: generic management of keywords implemented in other keywords (additionalProperties, patternProperties)
2016-12-11 16:22:02 +00:00
Evgeny Poberezkin
8a470f32df
docs: getKeyword, removeKeywords methods
2016-12-11 12:38:13 +00:00
Evgeny Poberezkin
7bfc868816
test: getKeyword, removeKeyword methods
2016-12-11 12:12:27 +00:00
Evgeny Poberezkin
506370804a
feat: get and remove custom keywords from the Ajv instance, related to #371
2016-12-11 11:17:37 +00:00
Evgeny Poberezkin
f3577a3b34
refactor: moved switch, patternRequired, formatMinimum/Maximum to ajv-keywords, #371
2016-12-10 22:00:42 +00:00
Evgeny Poberezkin
34b0101eb6
Merge branch 'master' into 5.0.0
2016-12-10 20:45:08 +00:00
Evgeny Poberezkin
5081be2720
refactor: make variable for package names local, closes #325 , #117
2016-12-06 21:29:02 +00:00
Minchenko Valery
06fdf7175e
Store require paths for optional dependencies in variables
...
remove warnings about missing dpendencies for webpack
2016-12-06 16:44:11 +03:00
Evgeny Poberezkin
1c3762c0e8
fix: remove duplicated return from generated code, correct error message
2016-12-02 17:48:56 +00:00
Evgeny Poberezkin
547b44013d
Merge branch 'domoritz-patch-1' into 5.0.0
2016-11-30 21:03:25 +00:00
Evgeny Poberezkin
eb8353ce6a
Merge branch 'master' into 5.0.0
2016-11-30 20:50:56 +00:00
Evgeny Poberezkin
445acb5afd
style: single quotes
2016-11-30 20:25:39 +00:00
Dominik Moritz
14cd94d3cf
Update types for options from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/types-2.0/ajv/index.d.ts
2016-11-29 19:53:52 -08:00
Nicholas Merritt
ac20d32eea
WIP
2016-11-25 23:20:20 +01:00
Evgeny Poberezkin
84bee02a61
refactor: MissingRefError class, closes #348
2016-11-25 20:37:03 +00:00
Evgeny Poberezkin
00bf5c77ee
fix: compare Date and RegExp objects, closes #342
2016-11-14 18:27:40 +00:00
Evgeny Poberezkin
d0c5a3904d
feat: make native es7 async function default mode for asynchronous validation, closes #338
2016-11-08 19:00:41 +00:00
Evgeny Poberezkin
98e0922ae7
Merge branch 'master' into 5.0.0
2016-11-08 17:37:08 +00:00
Evgeny Poberezkin
69f1e639d7
docs: compileAsync meta-schema support, closes #334
2016-11-08 17:32:22 +00:00
Evgeny Poberezkin
84b0531e39
feat: async loading of meta-schema, #334
2016-11-08 00:49:29 +00:00
Evgeny Poberezkin
599f579db4
refactor: do not bind ajv methods to the instance, closes #232
2016-10-21 21:33:32 +01:00
Evgeny Poberezkin
48cee59cb8
refactor: simplify compileAsync, #249
2016-10-20 21:12:34 +01:00
Evgeny Poberezkin
81c2069354
fix: type definition for option unknownFormats
2016-10-20 00:29:10 +01:00
Evgeny Poberezkin
3fab5c7019
fix: type definition change for compileAsync, closes #249
2016-10-19 09:52:58 +01:00
Evgeny Poberezkin
d54d92411c
fix: simplify #326
2016-10-19 08:24:30 +01:00
Etai Gross
ac4331b450
fix #326 by lazy-requiring js-beautify
...
only require beautify if the options are specified which would cause you to use it
2016-10-18 18:35:41 +03:00
Evgeny Poberezkin
f4a5f1005c
refactor: compileAsync returns promise; loadSchema option must return promise, #249
2016-10-17 22:52:24 +01:00
Evgeny Poberezkin
d9bcf2841a
refactor: move async compilation to separate file
2016-10-17 21:27:40 +01:00
Evgeny Poberezkin
c86e1bbc02
feat: make option unknownFormats default to true, closes #324
2016-10-16 18:59:40 +01:00
Evgeny Poberezkin
aa09a89e6c
Merge branch 'master' into 5.0.0
2016-10-16 17:43:22 +01:00
Evgeny Poberezkin
c55ef280dc
feat: optionally fail validation of unknown format passed via $data, #310
2016-10-16 16:11:25 +01:00
Evgeny Poberezkin
9bd850d115
feat: optionally throw exception during schema compilation if unknown format is used, #310
2016-10-16 11:57:49 +01:00
Evgeny Poberezkin
03051f90ba
feat: log errors using console.error/warn, closes #265
2016-10-05 20:50:37 +01:00
Evgeny Poberezkin
3e50b5da3c
feat: make option sourceCode default to false, closes #309
2016-10-05 20:36:49 +01:00
Evgeny Poberezkin
0bdb5a4fa5
feat: make option extendRef default to "fail", closes #294
2016-10-05 20:14:11 +01:00
Evgeny Poberezkin
40319b9e22
fix: message about changing default for extendRefs option, #303
2016-10-05 18:21:36 +01:00
Evgeny Poberezkin
a3ab001d5b
fix: do NOT log warning if extendRef is explicitely set to true, fix schema path in messages; closes #303
2016-10-05 18:11:31 +01:00
Evgeny Poberezkin
72a3bd0c2a
fix: allow segments of hostnames to start with digit, closes #312
2016-10-02 18:21:17 +01:00
Evgeny Poberezkin
7c95ec9fa8
fix: escaped characters in $refs, closes #311
2016-09-28 14:28:52 +01:00
Evgeny Poberezkin
812940d528
feat: only store patterns and defaults if option sourceCode is true
2016-09-24 16:11:29 +01:00
Evgeny Poberezkin
5193d45fdc
feat: add used defaults and patterns to validation function to support ajv-pack, #156
2016-09-24 15:58:14 +01:00
Evgeny Poberezkin
cdd30a9776
fix: allow null as schema value in keywords that support $data reference (constant)
2016-09-22 15:40:38 +01:00
Evgeny Poberezkin
acfd035720
refactor: replaced remaining eval with Function constructor
2016-09-19 20:16:27 +01:00
Darcy Parker
fd07efc4cf
Add missing rootData parameter from ValidateFunction typescript interface ( #301 )
...
* Add missing rootData property from ValidateFunction typescript interface
* Made change @epoberezkin requested
2016-09-19 12:49:37 +01:00
Evgeny Poberezkin
d272e05abe
refactor: rename option to sourceCode, #293
2016-09-06 21:48:42 +01:00
Russ Frank
792590b7b8
appease linter
2016-09-01 15:00:32 -07:00
Russ Frank
7d1e4d2c83
Add option to not retain validator source code
...
I noticed that in a program with many schemas, a large amount of memory
was taken up by the source code strings used to compile the validators.
This commit adds an option, `retainSourceCode`, default true, which
allows source code strings to be left out of the heap.
2016-08-31 16:25:00 -07:00
Evgeny Poberezkin
9dff6474d7
feat: pass schema compilation context (it) to compiled and macro custom keyword functions, closes #280
2016-08-29 22:56:07 +01:00
Evgeny Poberezkin
00f315c31f
feat: allowedValues param in "enum" keyword error, closes #282
2016-08-29 22:42:16 +01:00
Evgeny Poberezkin
3806b9d8a3
fix: correctly resolve $data refs with absolute JSON pointers, #289
2016-08-29 22:26:33 +01:00
Evgeny Poberezkin
33081b4911
feat: pass rootData to validating functions as 5th parameters, related to #289
2016-08-29 21:52:05 +01:00
Don Rouse
53e9971edd
Add JSON pointer support to $data reference.
2016-08-25 21:35:35 -07:00
Evgeny Poberezkin
7e7219212d
feat: allow refs with protocol-relative URIs, closes #277
2016-08-15 21:53:09 +01:00
Evgeny Poberezkin
2d9241a658
feat: allow refs to fragments in "getSchema" and "validate" methods, closes #47
2016-08-15 21:22:07 +01:00
Evgeny Poberezkin
84b900889f
refactor: function to check that schema has no rules except one specified (e.g. $ref)
2016-08-07 11:05:27 +01:00
Evgeny Poberezkin
c103dc04b9
feat: support validating [meta-]schemas against themselves, closes #259
2016-08-07 00:37:30 +01:00
Evgeny Poberezkin
804764dbec
Merge pull request #266 from epoberezkin/extend-refs
...
Option "extendRefs"
2016-08-06 22:13:12 +01:00
Evgeny Poberezkin
3185847572
feat: log warning if other keywords are used with "$ref", #260
2016-08-06 21:10:57 +01:00
Evgeny Poberezkin
39b4a8f637
feat: option "extendRefs" to fail compilation or to ignore other keywords when "$ref" is used, closes #260
2016-08-06 13:05:39 +01:00
Evgeny Poberezkin
27c612755a
Merge pull request #263 from dalcib/master
...
[typescript] Allow use 'new' operator
2016-08-06 00:06:39 +01:00
Evgeny Poberezkin
321a6d1a83
fix: date-time validation, closes #261
2016-08-05 11:57:58 +01:00
Victor Emanouilov
4246d726a9
chore: move date-time guard for missing time part to date_time function rather than date function
2016-08-05 09:53:00 +03:00
Dalci de Jesus Bagolin
2fc93a8acd
[typescript] Allow use 'new' operator
2016-08-04 22:41:17 -04:00
Victor Emanouilov
6df7b2040b
fix: date-time string validation to fail validating for date-only strings instead of throwing a TypeError
2016-08-04 13:49:53 +03:00
will Farrell
a21cf02f43
update `==`, `object <-> array`
2016-07-26 14:43:20 -06:00
will Farrell
ec09c3c735
allow reversal and add more tests
2016-07-24 19:03:27 -06:00
will Farrell
4d1aa5fe31
linting
2016-07-22 18:41:57 -06:00
will Farrell
9e18e68ce7
Add in ability to coerce to an array
2016-07-22 18:07:10 -06:00
Evgeny Poberezkin
d64b84f5ff
Merge branch 'master' into 4.2
2016-07-22 15:00:44 +01:00
Evgeny Poberezkin
ac5c746f0a
Revert "Revert "feat: meta schema for custom keywords schemas, closes #230""
...
This reverts commit 09879d21ad
.
2016-07-22 14:49:43 +01:00
Evgeny Poberezkin
5a80c7cff6
feat: support meta-schema validation in custom keywords with $data support, #146
2016-07-22 14:25:41 +01:00
Evgeny Poberezkin
f06008a84f
fix: error when mutually recursive fragment refs reference a common schema, closes #240
2016-07-22 00:37:35 +01:00
Evgeny Poberezkin
7f5fe70cdb
feat: $data support in custom keywords, #146
2016-07-19 22:50:10 +01:00
Evgeny Poberezkin
ab4f65800b
refactor: remove parallel ifs from def.$data partial
2016-07-18 22:27:17 +01:00
Evgeny Poberezkin
caf7557bc0
refactor: convert custom.def partial into custom.jst function (for better encapsulation)
2016-07-18 22:14:02 +01:00
Evgeny Poberezkin
09879d21ad
Revert "feat: meta schema for custom keywords schemas, closes #230"
...
This reverts commit 1a6e4b576c
.
2016-07-18 18:51:57 +01:00
Evgeny Poberezkin
1a6e4b576c
feat: meta schema for custom keywords schemas, closes #230
2016-07-17 11:20:47 +01:00
Evgeny Poberezkin
2bcb74fc8c
fix: support mutual recursive refs when both refs are schema fragments, closes #210
2016-07-10 18:36:09 +01:00
Evgeny Poberezkin
7e0482619d
fix: support control characters in "properties" and "required", closes #226
2016-07-09 23:16:24 +01:00
Evgeny Poberezkin
3f96062745
fix: ref resolution does not fail when it should; closes #220
2016-06-28 21:30:55 +01:00
Dan Casey
3de58ec4cd
Add `schema` to interface returned by `getSchema`
2016-06-26 16:00:23 -04:00
Evgeny Poberezkin
8c0b3d8321
fix custom keyword that defines errors, closes #181
2016-06-11 12:00:10 +01:00
Evgeny Poberezkin
95c40a55d4
fix: v5 with "schemas" option when schemas dont have $schema keyword (or use v5 metaschema), closes #204
2016-06-01 07:01:46 +01:00
Evgeny Poberezkin
9a9ba82729
refactor, bump version
2016-05-27 21:21:11 +01:00
Matt Broadstone
84ef7ab728
feat(own-properties): support optionally checking own properties
...
Traditionally ajv validates additionalProperties by checking all
enumerable properties of an object. This patch allows the user to
specify that they only want own properties of an object to be
considered in this validation
2016-05-26 17:50:52 -04:00
Evgeny Poberezkin
81f442b325
NaN validation, closes #182
2016-05-16 22:05:08 +01:00
Evgeny Poberezkin
68cfec3b99
Merge pull request #184 from HolgerJeromin/patch-1
...
Copy jsdoc comments to typescript definition file
2016-05-16 20:53:44 +01:00
Evgeny Poberezkin
d90e7abd45
fix no-invalid-rule, closes #187 , #188
2016-05-16 20:51:48 +01:00
Holger Jeromin
c28a2f8f5d
Removed internal Parameters and added .errors
2016-05-13 00:54:18 +02:00
Holger Jeromin
1726e98878
copy jsdoc comment to typescript definition file
2016-05-10 11:25:18 +02:00
Evgeny Poberezkin
a8af73f45f
fix incorrect change of resolution scope when sibling subschema has id in switch keyword, issue #170
2016-04-23 19:36:47 +01:00
Evgeny Poberezkin
07f344e752
fix incorrect change of resolution scope when sibling subschema has id in allOf, oneOf, anyOf and dependencies keywords, issue #170
2016-04-23 17:00:32 +01:00
Evgeny Poberezkin
a2610bca0d
fix incorrect change of resolution scope when sibling schema has id, closes #170
2016-04-23 14:56:16 +01:00
Evgeny Poberezkin
2db1de98f3
removed unused variable
2016-04-22 10:21:51 +01:00
Blake Embrey
67f224630a
TypeScript: Fix implicit any, fix `Promise` usage
2016-04-21 17:38:06 -07:00
Evgeny Poberezkin
254deb5a03
Merge pull request #165 from epoberezkin/typescript
...
TypeScript type definitions - corrections
2016-04-20 21:20:49 +01:00
Evgeny Poberezkin
a954845be2
use typescript ES2015 for Promise support
2016-04-20 21:01:22 +01:00
Evgeny Poberezkin
f7bfc49a55
fix and add tests for typescript type definitions
2016-04-20 20:55:43 +01:00
Evgeny Poberezkin
18ca34253f
TypeScript type definitions
2016-04-18 22:11:26 +01:00
Evgeny Poberezkin
44dd6b78b9
Android 4 compatibility, #143
2016-04-18 21:15:38 +01:00
Evgeny Poberezkin
76bdf0796e
TypeScript: Promise return value for validation functions
2016-04-17 20:10:12 +01:00
Evgeny Poberezkin
e1f30a201b
TypeScript format and keyword definition
2016-04-17 20:07:00 +01:00
Evgeny Poberezkin
6a2c8633cb
correct TypeScript definitions
2016-04-17 19:37:40 +01:00
Evgeny Poberezkin
8020465d74
Merge branch 'master' into v4.0
2016-04-15 22:20:40 +01:00
Evgeny Poberezkin
26964e4996
Merge pull request #150 from lyngaas/format-exclusive-names
...
Rename exclusiveFormat to formatExclusive (v5 draft)
2016-04-15 22:16:30 +01:00
Evgeny Poberezkin
b92e6e86a7
property dependencies in allErrors mode create error for each missing dependency; #151 , closes 73
2016-04-15 22:10:30 +01:00
Blake Embrey
83427b8712
Support initial TypeScript definition
2016-04-15 12:20:35 -07:00
Evgeny Poberezkin
d730049184
meteor compatibility: error reporting, closes #159
2016-04-11 20:40:31 +01:00
Evgeny Poberezkin
84e8782605
rename property "async" of asynchronous validation function to "$async" for meteor compatibility, #151 , #159
2016-04-10 20:17:06 +01:00
Evgeny Poberezkin
d3d31d285a
Merge branch 'master' into v4.0
2016-04-10 20:03:03 +01:00
Evgeny Poberezkin
8676a3f62e
meteor compatibility; closes #159
2016-04-10 11:44:22 +01:00
Evgeny Poberezkin
404bff5bcf
error parameters for formatMaximum/formatMinimum, #151
2016-03-26 22:35:46 +00:00
Evgeny Poberezkin
e6a22be556
fix type coercion for multiple items/properties; closes #152
2016-03-25 20:13:39 +00:00
Evgeny Poberezkin
cbd9467bd6
useDefaults: use literals (deep-clone) of defaults unless useDefaults: "shared" is passed, #151 , #136
2016-03-24 23:27:13 +00:00
Evgeny Poberezkin
69d897f31a
fix errorsTexts
2016-03-23 23:25:54 +00:00
Ståle Lyngaas
98368bc363
Rename exclusiveFormat to formatExclusive (v5 draft)
2016-03-22 19:40:15 +01:00
Evgeny Poberezkin
dc10816fc3
refactor using options ignored for meta schemas
2016-03-20 18:12:14 +00:00
Evgeny Poberezkin
6a587c8729
restore readme in dotjs folder
2016-03-15 08:43:54 +00:00
Evgeny Poberezkin
ce86641657
pass default meta-schema via "meta" option, closes #90
2016-03-14 20:56:07 +00:00
Evgeny Poberezkin
192d73f74e
use meta schema from options as default meta-schema
2016-03-14 00:16:38 +00:00
Evgeny Poberezkin
f068d73693
add meta schema from option meta, #90
2016-03-13 23:15:37 +00:00
Evgeny Poberezkin
e1a38d2d90
accept array of schemas in addMetaSchema method
2016-03-09 23:20:35 +00:00
Brian Stack
bf76acfc21
Make cloning optional and based on stringify
2016-03-03 11:23:49 -08:00
Brian Stack
82f283fe7e
Clone default values to do least surprising thing
2016-03-02 16:04:21 -08:00
Evgeny Poberezkin
f4ca190010
fixed browser tests for async validation
2016-03-02 07:09:11 +00:00
Evgeny Poberezkin
53a6c70138
asynchronous custom keywords can define custom errors by returning the promise that rejects with Ajv.ValidationError, closes #118
2016-02-28 22:14:18 +00:00
Evgeny Poberezkin
3aaeaf6ec0
removeSchema with RegExp to remove multiple schemas or without argument to remove all schemas, closes #103
2016-02-28 01:16:48 +00:00
Evgeny Poberezkin
f48efb564a
optimised "not" keyword in {allErrors: true} mode to fail on the first error in subschema, closes #131
2016-02-27 23:01:03 +00:00
Evgeny Poberezkin
ec0f1c1b22
patternRequired keyword (v5 proposal), closes #123
2016-02-27 22:36:11 +00:00
Evgeny Poberezkin
503b427b7f
eslint no-trailing spaces
2016-02-26 20:25:15 +00:00
Evgeny Poberezkin
bdd1748dec
schema: false option in "validate" custom keyword definition for custom keywords that do not depend on the schema
2016-02-21 13:27:38 +00:00
Evgeny Poberezkin
8fa4d0f05f
test for passContext option
2016-02-16 10:12:32 +00:00
Evgeny Poberezkin
de65510f1e
passContext option; pass parent data to custom keyword functions
2016-02-16 00:15:20 +00:00
Evgeny Poberezkin
14d0eb0645
fix inlineRefs option, fix test, fix $ref to pass parentData[Property] to the referenced schema if it was passed to validate function
2016-02-15 22:04:04 +00:00
Evgeny Poberezkin
b2a67e7a65
options passContext (undocumented) to pass the context of validation function to referenced (not inlined) schemas
2016-02-14 20:34:10 +00:00
Evgeny Poberezkin
a0a172c90a
removeSchema called with id without matching schema does not throw error
2016-02-13 20:14:04 +00:00
Evgeny Poberezkin
79d16b3dee
alvays pass parent data and current data property when referenced schema called as a function (previously was passed only with option coerceTypes)
2016-02-12 23:08:28 +00:00
Evgeny Poberezkin
fa6b702db0
error message for enum keyword, closes #115
2016-02-07 20:03:14 +00:00
Evgeny Poberezkin
c62c6452aa
eslint: no-console
2016-02-04 22:36:12 +00:00
Evgeny Poberezkin
5c8e32dffc
eslint: no-shadow, no-invalid-this
2016-02-04 22:24:59 +00:00
Evgeny Poberezkin
5db986276c
fixed bug: custom sync keyword in async schema
2016-02-04 19:56:04 +00:00
Evgeny Poberezkin
2f6213111d
validate method for asynchronous schema always returns promise
2016-02-02 23:42:07 +00:00
Evgeny Poberezkin
cc32c46a25
update json-stable-stringify; closes #67
2016-02-02 21:39:45 +00:00
Evgeny Poberezkin
89a5ce76f9
eslint; code style
2016-02-02 18:55:02 +00:00
Evgeny Poberezkin
644a73b8f7
enable tests for nodent
2016-02-01 17:56:47 +00:00
Evgeny Poberezkin
0ecd3eaa13
change async/transpile options
2016-01-31 22:07:19 +00:00