Evgeny Poberezkin
53b5682cb7
fix: the unknown keyword in the schema without known keywords inside compound schema (e.g. anyOf) is ignored with strictKeywords option
2019-07-13 21:38:44 +01:00
Evgeny Poberezkin
761aac1b5d
refactor: optimize validation of additional/patternProperties and propertyNames with option ownProperties, closes #197
2017-02-12 18:31:40 +00:00
Evgeny Poberezkin
df6ef691ae
fix: ownProperties option with required keyword, #197
2017-02-11 23:44:59 +00:00
Evgeny Poberezkin
a06327eab4
Merge branch 'master' into 5.0.0
2017-01-20 23:30:54 +00:00
Evgeny Poberezkin
33845cc397
feat: support custom keywords that modify data, #392
2017-01-20 22:03:36 +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
f1028c8411
feat: support boolean schemas in $ref
2016-12-25 17:43:26 +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
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
cdd30a9776
fix: allow null as schema value in keywords that support $data reference (constant)
2016-09-22 15:40:38 +01:00
Evgeny Poberezkin
ab4f65800b
refactor: remove parallel ifs from def.$data partial
2016-07-18 22:27:17 +01:00
Evgeny Poberezkin
9a9ba82729
refactor, bump version
2016-05-27 21:21:11 +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
de65510f1e
passContext option; pass parent data to custom keyword functions
2016-02-16 00:15:20 +00:00
Evgeny Poberezkin
0729d6d19d
async schemas and async formats using generators, #40
2016-01-25 06:37:36 +00:00
Evgeny Poberezkin
2eef59dede
minified browser bundle
2015-12-27 21:33:07 +00:00
Evgeny Poberezkin
f449f68a3d
safe access with guards to $data ref
2015-12-25 22:36:23 +00:00
Evgeny Poberezkin
1d9cad5ab7
$data ref equal to undefined is always valid
2015-12-25 20:10: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
3915d22a22
refactor
2015-12-23 16:45:54 +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
aa18f7cab1
support $data ref in max/minLength, max/minItems and max/minProperties keywords, #81
2015-12-20 22:40:19 +00:00
Evgeny Poberezkin
1c5be913b6
correctly report schema path, #80
2015-12-19 10:52:39 +00:00
Evgeny Poberezkin
081f061371
more tests for switch keyword
2015-12-12 19:43:38 +00:00
Evgeny Poberezkin
8114a2b442
tests for switch keyword
2015-12-12 18:14:53 +00:00
Evgeny Poberezkin
318af74629
switch keyword
2015-12-12 13:41:51 +00:00
Evgeny Poberezkin
7c7abbbc74
"parentSchema" property added to error objects when using "verbose" option
2015-12-11 21:35:14 +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
7d96e1b642
patternGroups keyword (v5 proposals)
2015-11-28 14:59:08 +00:00
Evgeny Poberezkin
cf35958df4
schemaPath in errors, #76
2015-11-27 09:19:04 +00:00
Evgeny Poberezkin
56a8b5b582
"dependencies" with option errorDataPath = "property" sets dataPath to missing property, error params has missingProperty, #68 , #69
2015-11-21 12:43:44 +00:00
Evgeny Poberezkin
5c0c8b3b1c
default behaviour of "additionalProperties" in >=2.0.0 ( #69 ) reverts #11 - now dataPath points to the object that is validated and not to the additional property; old (<=1.4.10 ) error reporting of dataPath for "additionalProperties" keyword is available with option errorDataPath == "property"
2015-11-21 01:45:52 +00:00
Evgeny Poberezkin
a46600e14a
default behaviour in >=2.0.0 ( #69 ) reverts #18 and #55 - now dataPath points to the object that is validated and not to the missing property; old (<=1.4.10 ) error reporting of dataPath for "required" keyword is available with option errorDataPath == "property"
2015-11-19 23:59:10 +00:00
Evgeny Poberezkin
982264f192
removed i18n option (params always added to error objects)
2015-11-17 23:45:19 +00:00
Evgeny Poberezkin
6a2961bcf3
updated error parameters so that ajv-i18n does not depend on schema, compatible with ajv-i18n >= 1.0.0
2015-11-17 23:20:12 +00:00
Evgeny Poberezkin
fcc776e794
basic implementation of custom keywords, #69
2015-11-17 23:17:59 +00:00
Evgeny Poberezkin
7b142c56bd
optimized generated code for deep schemas
2015-10-25 21:55:07 +00:00
Marc MacLeod
71e8ff3f2c
update the required message rather than dataPath
2015-09-26 12:11:20 -05:00
Evgeny Poberezkin
34993de951
i18n support for ajv-i18n package
2015-09-13 01:01:20 +01:00
Evgeny Poberezkin
f3b65f4a58
Merge branch 'master' into inline
2015-08-23 12:04:38 +01:00
Blake Embrey
e6da675f91
Support JSON pointers
2015-08-22 11:52:05 -07:00
Evgeny Poberezkin
7d0c6d1d25
inline simple refs, #6
2015-08-19 22:54:05 +01:00
Evgeny Poberezkin
8abbf63e9b
Merge branch 'master' into 1.0.0
2015-08-16 23:00:43 +01:00
Evgeny Poberezkin
dfd6de5857
removed _debug option
2015-08-16 00:59:28 +01:00
Evgeny Poberezkin
22513f598a
Merge branch 'master' into 1.0.0
2015-08-07 23:17:06 +01:00
Evgeny Poberezkin
bde23cbe9e
removed type escaping in errors
2015-08-07 00:14:08 +01:00