|
1 | 1 | [
|
2 | 2 | {
|
3 | 3 | "description": "propertyNames validation",
|
| 4 | + "specification": [ { "core": "10.3.2.4" } ], |
4 | 5 | "schema": {
|
5 | 6 | "$schema": "https://json-schema.org/draft/2020-12/schema",
|
6 | 7 | "propertyNames": {"maxLength": 3}
|
|
46 | 47 | },
|
47 | 48 | {
|
48 | 49 | "description": "propertyNames with boolean schema true",
|
| 50 | + "specification": [ { "core": "10.3.2.4", "quote": "The value of \"propertyNames\" MUST be a valid JSON Schema." } ], |
49 | 51 | "schema": {
|
50 | 52 | "$schema": "https://json-schema.org/draft/2020-12/schema",
|
51 | 53 | "propertyNames": true
|
|
65 | 67 | },
|
66 | 68 | {
|
67 | 69 | "description": "propertyNames with boolean schema false",
|
| 70 | + "specification": [ { "core": "10.3.2.4", "quote": "The value of \"propertyNames\" MUST be a valid JSON Schema." } ], |
68 | 71 | "schema": {
|
69 | 72 | "$schema": "https://json-schema.org/draft/2020-12/schema",
|
70 | 73 | "propertyNames": false
|
|
81 | 84 | "valid": true
|
82 | 85 | }
|
83 | 86 | ]
|
| 87 | + }, |
| 88 | + { |
| 89 | + "description": "propertyNames with additionalProperties", |
| 90 | + "specification": [ { "core": "10.3.2.4" }, { "core": "10.3.2.3", "quote": "The validation of propertyNames remains unaffected by the presence or absence of additionalProperties. \"propertyNames\" are validated independently, regardless of other sibling keywords" } ], |
| 91 | + "schema": { |
| 92 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 93 | + "additionalProperties":{ |
| 94 | + "type": "number" |
| 95 | + }, |
| 96 | + "propertyNames": { |
| 97 | + "maxLength": 5 |
| 98 | + } |
| 99 | + }, |
| 100 | + "tests": [ |
| 101 | + { |
| 102 | + "description": "property names with the given pattern are valid", |
| 103 | + "data": {"apple": 4}, |
| 104 | + "valid": true |
| 105 | + }, |
| 106 | + { |
| 107 | + "description": "property name is invalid", |
| 108 | + "data": { "watermelon": 6 }, |
| 109 | + "valid": false |
| 110 | + } |
| 111 | + ] |
| 112 | + }, |
| 113 | + { |
| 114 | + "description": "propertyNames with unevaluatedProperties", |
| 115 | + "specification": [ { "core": "10.3.2.4" }, { "core":"11.3", "quote": "The validation of propertyNames remains unaffected by the presence or absence of unevaluatedProperties. \"propertyNames\" are validated independently, regardless of other sibling keywords" } ], |
| 116 | + "schema": { |
| 117 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 118 | + "properties":{ |
| 119 | + "banana":{ |
| 120 | + "const": "available" |
| 121 | + } |
| 122 | + }, |
| 123 | + "unevaluatedProperties":{ |
| 124 | + "type": "number" |
| 125 | + }, |
| 126 | + "propertyNames": { |
| 127 | + "pattern": "^[a-b]" |
| 128 | + } |
| 129 | + }, |
| 130 | + "tests": [ |
| 131 | + { |
| 132 | + "description": "property names with the given pattern are valid", |
| 133 | + "data": { "banana": "available", "apple": 4 }, |
| 134 | + "valid": true |
| 135 | + }, |
| 136 | + { |
| 137 | + "description": "property name chickoo is invalid", |
| 138 | + "data": { "banana": "available", "chickoo": 10 }, |
| 139 | + "valid": false |
| 140 | + } |
| 141 | + ] |
84 | 142 | }
|
85 | 143 | ]
|
0 commit comments