Commit Graph

275 Commits (80d249ac7fc92c125d2217f53e29b6e24f3566c1)

Author SHA1 Message Date
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 484df70eb5 feat: support boolean schemas, #367 2016-12-24 23:04:07 +00:00
Evgeny Poberezkin 82775ee8de feat: draft6 propertyName keyword (standard, inline) 2016-12-23 23:45:48 +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 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 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 a607d4f422 refactor: generic management of keywords implemented in other keywords (additionalProperties, patternProperties) 2016-12-11 16:22:02 +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 eb8353ce6a Merge branch 'master' into 5.0.0 2016-11-30 20:50:56 +00: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 98e0922ae7 Merge branch 'master' into 5.0.0 2016-11-08 17:37:08 +00:00
Evgeny Poberezkin 84b0531e39 feat: async loading of meta-schema, #334 2016-11-08 00:49:29 +00:00
Evgeny Poberezkin 48cee59cb8 refactor: simplify compileAsync, #249 2016-10-20 21:12:34 +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 3e50b5da3c feat: make option sourceCode default to false, closes #309 2016-10-05 20:36:49 +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 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 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 3806b9d8a3 fix: correctly resolve $data refs with absolute JSON pointers, #289 2016-08-29 22:26:33 +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 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 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
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 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 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
Evgeny Poberezkin 81f442b325 NaN validation, closes #182 2016-05-16 22:05:08 +01:00
Evgeny Poberezkin d90e7abd45 fix no-invalid-rule, closes #187, #188 2016-05-16 20:51:48 +01:00
Evgeny Poberezkin 44dd6b78b9 Android 4 compatibility, #143 2016-04-18 21:15:38 +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 69d897f31a fix errorsTexts 2016-03-23 23:25:54 +00:00
Evgeny Poberezkin 503b427b7f eslint no-trailing spaces 2016-02-26 20:25:15 +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 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 89a5ce76f9 eslint; code style 2016-02-02 18:55:02 +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 6e583554a1 async with nodent transpiler 2016-01-29 09:26:11 +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 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 878f3559f6 do not try to coerce to object/array, #95 2016-01-17 13:12:28 +00:00
Evgeny Poberezkin 5b7d9f9ff7 fixed inline reference resolution 2016-01-16 14:33:46 +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 0b725bbc31 "default" keyword in "properties" subschemas, #42 2016-01-09 01:07:33 +00:00
Evgeny Poberezkin a1afce910c prevent scope change if definitions uses id 2016-01-04 22:28:05 +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 f449f68a3d safe access with guards to $data ref 2015-12-25 22:36:23 +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 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 1c5be913b6 correctly report schema path, #80 2015-12-19 10:52:39 +00:00
Evgeny Poberezkin 610dcd17eb replace $ in properties with $$ replace pattern, closes #87 2015-12-07 21:55:38 +00:00
Evgeny Poberezkin d7fd8229a9 time format; formatMaximum/formatMinimum and exclusiveFormatMaximum/exclusiveFormatMinimum keywords from v5 proposals 2015-12-05 21:16:28 +00:00
Evgeny Poberezkin 8a0719ea27 additionalItems added to reserved keywords (can be defined as custom) 2015-11-28 16:11:56 +00:00
Evgeny Poberezkin 65e534ee8b check/extend errors in inline custom keywords; tests for custom keywords creating errors 2015-11-21 23:12:03 +00:00
Evgeny Poberezkin ee450ec8d0 removed caching of compiled subschemas of custom keywords (it made performance worse in most cases) 2015-11-17 23:20:12 +00:00
Evgeny Poberezkin ae5b4c0f45 support for "inline" custom keywords, #69 2015-11-17 23:20:12 +00:00
Evgeny Poberezkin 87292f80ea validate schemas generated by macro keywords 2015-11-17 23:20:12 +00:00
Evgeny Poberezkin 18c1ef858c support for "macro" custom keywords, #69 2015-11-17 23:20:11 +00:00
Evgeny Poberezkin 285850ce20 pass parent schema to compile/validate functions of custom keywords if they use it, #69 2015-11-17 23:17:59 +00:00
Evgeny Poberezkin 5e45d4eadf support compiling schemas in custom keywords, #69 2015-11-17 23:17:59 +00:00