Commit Graph

315 Commits (ecd1ed455d02f8e5406815889ced04788e89f2a2)

Author SHA1 Message Date
Evgeny Poberezkin 57e09aab22
test: control characters in "enum" and "dependencies", #226 2016-07-09 23:39:26 +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 28711287ff
test: failing test for #226: control chars in schema JSON 2016-07-08 22:11: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
Evgeny Poberezkin aa2ee31381 test: sync failing test for issue #220 2016-06-28 21:17:07 +01:00
Evgeny Poberezkin 5e7094754f test: failing test for issue #220 2016-06-28 21:09:04 +01:00
Evgeny Poberezkin 11c3f1483b failing test for issue #210 2016-06-18 22:15:39 +01:00
Evgeny Poberezkin 8c0b3d8321 fix custom keyword that defines errors, closes #181 2016-06-11 12:00:10 +01:00
Evgeny Poberezkin 6a14e347c4 use new with Ajv constructor in tests and examples 2016-06-04 21:16:11 +01:00
Evgeny Poberezkin dbf1b06c66 test for issue #204 (options schemas and v5) 2016-06-01 07:07:34 +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 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 939ae53f7d failing test for #170 (ref resolution when sibling has id) 2016-04-23 13:49:23 +01:00
Evgeny Poberezkin 44dd6b78b9 Android 4 compatibility, #143 2016-04-18 21:15:38 +01:00
Evgeny Poberezkin 9fd6ac8044 test timeout 2016-04-15 22:35:19 +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
Evgeny Poberezkin d3d31d285a Merge branch 'master' into v4.0 2016-04-10 20:03:03 +01:00
Evgeny Poberezkin 19f94a1cd3 aditional coercion test (#152) 2016-03-25 20:45:53 +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
Ståle Lyngaas 98368bc363 Rename exclusiveFormat to formatExclusive (v5 draft) 2016-03-22 19:40:15 +01:00
Evgeny Poberezkin ce86641657 pass default meta-schema via "meta" option, closes #90 2016-03-14 20:56:07 +00:00
Evgeny Poberezkin d7bbf33478 bump version 2016-03-07 06:49:51 +00:00
Evgeny Poberezkin d47ff8b843 Merge pull request #136 from imbstack/dont-alter-underlying
Clone default values to avoid seemingly surprising behavior
2016-03-03 19:40:49 +00:00
Brian Stack bf76acfc21 Make cloning optional and based on stringify 2016-03-03 11:23:49 -08:00
Evgeny Poberezkin a7a4ac57bd fixed instances list for async test; readme re removeAdditional (related to #129, #134) 2016-03-03 00:28:44 +00:00
Brian Stack 4928b76605 Add failing test to reveal surprising behavior 2016-03-02 09:59:17 -08:00
Evgeny Poberezkin 71fafc27a4 fixed browsers async tests 2016-03-02 14:56:56 +00:00
Evgeny Poberezkin f4ca190010 fixed browser tests for async validation 2016-03-02 07:09:11 +00:00
Evgeny Poberezkin 700cfb01a6 exclude es7.regenerator async test when running in Safari 2016-03-01 20:44:41 +00:00
Evgeny Poberezkin bb243695c6 removed browser test badge 2016-02-29 23:47:15 +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 8fa4d0f05f test for passContext option 2016-02-16 10:12:32 +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 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 5db986276c fixed bug: custom sync keyword in async schema 2016-02-04 19:56:04 +00:00
Evgeny Poberezkin 38827f50d4 refactor async tests 2016-02-03 22:14:14 +00:00
Evgeny Poberezkin b4f756d403 fixed the list of instances in async validation test 2016-02-02 23:55:30 +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 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
Evgeny Poberezkin 86d97d4337 async options, expose Ajv.ValidationError class 2016-01-30 22:13:00 +00:00
Evgeny Poberezkin c19c02aa04 nodent usage 2016-01-29 23:29:45 +00:00
Evgeny Poberezkin 2fe6715e3c readme: async and transpile options 2016-01-29 18:01:03 +00:00
Evgeny Poberezkin dba7096f2b additional check for compatibility with nodent 2016-01-29 15:11:13 +00:00
Evgeny Poberezkin a951e66e51 readme: asynchronous validation; no co in the test with es7 async functions 2016-01-29 12:45:59 +00:00
Evgeny Poberezkin 6e583554a1 async with nodent transpiler 2016-01-29 09:26:11 +00:00
Evgeny Poberezkin 7365dd6e41 transpiling async validation functions from es7 with nodent 2016-01-28 12:31:20 +00:00
Evgeny Poberezkin 98c9c195aa references to async schemas 2016-01-27 23:43:28 +00:00
Evgeny Poberezkin 002c99311f use regenerator to transpile asynchronous validation functions if generators are not supported, #40 2016-01-26 23:56:38 +00:00
Evgeny Poberezkin cf978706d1 Merge branch 'master' into async 2016-01-26 21:44:09 +00:00
Evgeny Poberezkin 8b8ab4b086 fixed browser tests with the new brfs version 2016-01-26 13:18:50 +00:00
Evgeny Poberezkin 873426b6a7 async custom keywords, #40 2016-01-25 23:57:16 +00:00
Evgeny Poberezkin d5808a3ee4 async format when format is $data, #40 2016-01-25 22:05:15 +00:00
Evgeny Poberezkin 0729d6d19d async schemas and async formats using generators, #40 2016-01-25 06:37:36 +00:00
Evgeny Poberezkin 27bd49f182 renamed opts property of ajv instance to _opts; options object passed to constructor is copied 2016-01-25 06:37:36 +00:00
Evgeny Poberezkin 0c60364a7f coerce type when schema is in ref that is not inlined, #95 2016-01-17 14:08:50 +00:00
Evgeny Poberezkin 878f3559f6 do not try to coerce to object/array, #95 2016-01-17 13:12:28 +00:00
Evgeny Poberezkin b5b6a06f09 coerceTypes option, #95 2016-01-17 01:05:06 +00:00
Evgeny Poberezkin 5b7d9f9ff7 fixed inline reference resolution 2016-01-16 14:33:46 +00:00
Evgeny Poberezkin c99d6751ad option addUsedSchema 2016-01-15 06:54:53 +00:00
Evgeny Poberezkin 8c4557f1ac fixed relative json-pointer pattern/code to access data 2016-01-14 21:31:00 +00:00
Evgeny Poberezkin 37dd0415da fixed relative JSON-pointer pattern 2016-01-13 22:23:32 +00:00
Evgeny Poberezkin 8fe96db455 refactored "default" to correctly validate minProperties, minItems, etc. when defaults are present, closes #42 2016-01-09 13:28:40 +00:00
Evgeny Poberezkin 94a8f9abb3 useDefaults readme 2016-01-09 11:37:21 +00:00
Evgeny Poberezkin d7dd660d25 "default" keyword in "items" subschemas, #42 2016-01-09 01:37:45 +00:00
Evgeny Poberezkin 0b725bbc31 "default" keyword in "properties" subschemas, #42 2016-01-09 01:07:33 +00:00
Evgeny Poberezkin 5f2cc30449 option multipleOfPrecision, closes #84 2016-01-02 17:16:01 +00:00
Evgeny Poberezkin c3d09d7699 fixed bug in dependencies keyword, closes #94 2015-12-30 23:04:14 +00:00
Evgeny Poberezkin 81d8a2ee6f fixed the test that was failing in IE9 2015-12-27 22:42:02 +00:00
Evgeny Poberezkin 2eef59dede minified browser bundle 2015-12-27 21:33:07 +00:00
Evgeny Poberezkin 694e81684f throw exception if custom keyword is not an identifier; update tests as macro keyword definition supports type 2015-12-26 23:04:45 +00:00
Evgeny Poberezkin c4786866e2 simplify compiling macro keywords 2015-12-26 22:27:13 +00:00
Evgeny Poberezkin eab087a792 loopRequired option 2015-12-26 00:05:39 +00:00
Evgeny Poberezkin 1d9cad5ab7 $data ref equal to undefined is always valid 2015-12-25 20:10:15 +00:00
Evgeny Poberezkin 2d7b06a6db support $data ref in required keyword, #81 2015-12-25 00:30:50 +00:00
Evgeny Poberezkin 2ab6aba454 support $data ref in uniqueItems, #81 2015-12-24 18:58:15 +00:00
Evgeny Poberezkin 10c6685027 support $data ref in formatMaximum/Minimum and exclusiveFormatMaximum/Minimum, #81 2015-12-24 17:43:48 +00:00
Evgeny Poberezkin abff815d38 refactored schema compilation to reduce browser bundle size 2015-12-23 01:50:11 +00:00
Evgeny Poberezkin a38bf04418 refactor keywords with common code 2015-12-22 17:03:09 +00:00
Evgeny Poberezkin cdf172c2b8 support $data ref in constant keyword, #81; constant keyword is implemented as inline, closes #91 2015-12-22 11:47:12 +00:00
Evgeny Poberezkin 8648a98047 support $data ref in format keyword, #81 2015-12-22 01:18:52 +00:00
Evgeny Poberezkin ae4e6009a1 support $data ref in maximum/minimum and exclusiveMaximum/Minimum keywords, #81 2015-12-21 15:37:12 +00:00
Evgeny Poberezkin 4bb4059e80 $data ref in pattern and enum keywords, #81 2015-12-21 00:39:09 +00:00
Evgeny Poberezkin aa18f7cab1 support $data ref in max/minLength, max/minItems and max/minProperties keywords, #81 2015-12-20 22:40:19 +00:00
Evgeny Poberezkin 9d4be9c72a $data ref in multipleOf keyword, #81 2015-12-20 20:48:15 +00:00
Evgeny Poberezkin bed46b41aa relative-json-pointer format 2015-12-19 21:58:45 +00:00
Evgeny Poberezkin 984a70d36c json-pointer format 2015-12-19 21:23:40 +00:00
Evgeny Poberezkin 35214f3c68 uuid format 2015-12-19 20:03:41 +00:00
Evgeny Poberezkin ca80b2ec42 correct schemaPath for $refs, additionalProperties, additionalItems, etc. 2015-12-19 15:56:08 +00:00