diff --git a/README.md b/README.md index 6a82be93e..ce4507fdb 100644 --- a/README.md +++ b/README.md @@ -330,7 +330,7 @@ There are two modes of format validation: `fast` and `full`. This mode affects f You can add additional formats and replace any of the formats above using [addFormat](#api-addformat) method. -The option `unknownFormats` allows changing the default behaviour when an unknown format is encountered. In this case Ajv can either fail schema compilation (default) or ignore it (default in versions before 5.0.0). You also can allowlist specific format(s) to be ignored. See [Options](#options) for details. +The option `unknownFormats` allows changing the default behaviour when an unknown format is encountered. In this case Ajv can either fail schema compilation (default) or ignore it (default in versions before 5.0.0). You also can allow specific format(s) that will be ignored. See [Options](#options) for details. You can find regular expressions used for format validation and the sources that were used in [formats.js](https://github.com/ajv-validator/ajv/blob/master/lib/compile/formats.js). diff --git a/spec/extras/$data/format.json b/spec/extras/$data/format.json index b223fb92b..97c7fa797 100644 --- a/spec/extras/$data/format.json +++ b/spec/extras/$data/format.json @@ -3,7 +3,11 @@ "description": "one property has format set in another property", "schema": { "properties": { - "str": { "format": { "$data": "1/strFormat" } }, + "str": { + "format": { + "$data": "1/strFormat" + } + }, "strFormat": {} } }, @@ -49,7 +53,7 @@ "valid": false }, { - "description": "allowlisted unknown format is valid", + "description": "allowed unknown format is valid", "data": { "str": "any value", "strFormat": "allowedUnknown" @@ -57,7 +61,7 @@ "valid": true }, { - "description": "not allowlisted unknown format is invalid", + "description": "unknown format is invalid", "data": { "str": "any value", "strFormat": "completelyUnknown" @@ -85,7 +89,9 @@ "description": "property name is the format for the property value", "schema": { "additionalProperties": { - "format": { "$data": "0#" } + "format": { + "$data": "0#" + } } }, "tests": [ @@ -115,4 +121,4 @@ } ] } -] +] \ No newline at end of file diff --git a/spec/options/unknownFormats.spec.js b/spec/options/unknownFormats.spec.js index 018575140..6e6dfde3d 100644 --- a/spec/options/unknownFormats.spec.js +++ b/spec/options/unknownFormats.spec.js @@ -70,7 +70,7 @@ describe('unknownFormats option', function() { }); describe('= [String]', function() { - it('should pass schema compilation and be valid if alloylisted unknown format is used', function() { + it('should pass schema compilation and be valid if allowed unknown format is used', function() { test(new Ajv({unknownFormats: ['allowed']})); function test(ajv) { @@ -83,7 +83,7 @@ describe('unknownFormats option', function() { } }); - it('should be valid if alloylisted unknown format is used via $data', function() { + it('should be valid if allowed unknown format is used via $data', function() { test(new Ajv({$data: true, unknownFormats: ['allowed']})); function test(ajv) { diff --git a/spec/tests/rules/format.json b/spec/tests/rules/format.json index c7d2b07f0..433a0aaf8 100644 --- a/spec/tests/rules/format.json +++ b/spec/tests/rules/format.json @@ -1,6 +1,6 @@ [ { - "description": "alloylisted unknown format is valid", + "description": "allowed unknown format is valid", "schema": { "format": "allowedUnknown" },