|
97 | 97 | ] |
98 | 98 | }, |
99 | 99 | { |
100 | | - "description": "not with boolean schema true", |
| 100 | + "description": "forbid everything with empty schema", |
| 101 | + "schema": { |
| 102 | + "$schema": "https://json-schema.org/v1", |
| 103 | + "not": {} |
| 104 | + }, |
| 105 | + "tests": [ |
| 106 | + { |
| 107 | + "description": "number is invalid", |
| 108 | + "data": 1, |
| 109 | + "valid": false |
| 110 | + }, |
| 111 | + { |
| 112 | + "description": "string is invalid", |
| 113 | + "data": "foo", |
| 114 | + "valid": false |
| 115 | + }, |
| 116 | + { |
| 117 | + "description": "boolean true is invalid", |
| 118 | + "data": true, |
| 119 | + "valid": false |
| 120 | + }, |
| 121 | + { |
| 122 | + "description": "boolean false is invalid", |
| 123 | + "data": false, |
| 124 | + "valid": false |
| 125 | + }, |
| 126 | + { |
| 127 | + "description": "null is invalid", |
| 128 | + "data": null, |
| 129 | + "valid": false |
| 130 | + }, |
| 131 | + { |
| 132 | + "description": "object is invalid", |
| 133 | + "data": {"foo": "bar"}, |
| 134 | + "valid": false |
| 135 | + }, |
| 136 | + { |
| 137 | + "description": "empty object is invalid", |
| 138 | + "data": {}, |
| 139 | + "valid": false |
| 140 | + }, |
| 141 | + { |
| 142 | + "description": "array is invalid", |
| 143 | + "data": ["foo"], |
| 144 | + "valid": false |
| 145 | + }, |
| 146 | + { |
| 147 | + "description": "empty array is invalid", |
| 148 | + "data": [], |
| 149 | + "valid": false |
| 150 | + } |
| 151 | + ] |
| 152 | + }, |
| 153 | + { |
| 154 | + "description": "forbid everything with boolean schema true", |
101 | 155 | "schema": { |
102 | 156 | "$schema": "https://json-schema.org/v1", |
103 | 157 | "not": true |
104 | 158 | }, |
105 | 159 | "tests": [ |
106 | 160 | { |
107 | | - "description": "any value is invalid", |
| 161 | + "description": "number is invalid", |
| 162 | + "data": 1, |
| 163 | + "valid": false |
| 164 | + }, |
| 165 | + { |
| 166 | + "description": "string is invalid", |
108 | 167 | "data": "foo", |
109 | 168 | "valid": false |
| 169 | + }, |
| 170 | + { |
| 171 | + "description": "boolean true is invalid", |
| 172 | + "data": true, |
| 173 | + "valid": false |
| 174 | + }, |
| 175 | + { |
| 176 | + "description": "boolean false is invalid", |
| 177 | + "data": false, |
| 178 | + "valid": false |
| 179 | + }, |
| 180 | + { |
| 181 | + "description": "null is invalid", |
| 182 | + "data": null, |
| 183 | + "valid": false |
| 184 | + }, |
| 185 | + { |
| 186 | + "description": "object is invalid", |
| 187 | + "data": {"foo": "bar"}, |
| 188 | + "valid": false |
| 189 | + }, |
| 190 | + { |
| 191 | + "description": "empty object is invalid", |
| 192 | + "data": {}, |
| 193 | + "valid": false |
| 194 | + }, |
| 195 | + { |
| 196 | + "description": "array is invalid", |
| 197 | + "data": ["foo"], |
| 198 | + "valid": false |
| 199 | + }, |
| 200 | + { |
| 201 | + "description": "empty array is invalid", |
| 202 | + "data": [], |
| 203 | + "valid": false |
110 | 204 | } |
111 | 205 | ] |
112 | 206 | }, |
113 | 207 | { |
114 | | - "description": "not with boolean schema false", |
| 208 | + "description": "allow everything with boolean schema false", |
115 | 209 | "schema": { |
116 | 210 | "$schema": "https://json-schema.org/v1", |
117 | 211 | "not": false |
118 | 212 | }, |
| 213 | + "tests": [ |
| 214 | + { |
| 215 | + "description": "number is valid", |
| 216 | + "data": 1, |
| 217 | + "valid": true |
| 218 | + }, |
| 219 | + { |
| 220 | + "description": "string is valid", |
| 221 | + "data": "foo", |
| 222 | + "valid": true |
| 223 | + }, |
| 224 | + { |
| 225 | + "description": "boolean true is valid", |
| 226 | + "data": true, |
| 227 | + "valid": true |
| 228 | + }, |
| 229 | + { |
| 230 | + "description": "boolean false is valid", |
| 231 | + "data": false, |
| 232 | + "valid": true |
| 233 | + }, |
| 234 | + { |
| 235 | + "description": "null is valid", |
| 236 | + "data": null, |
| 237 | + "valid": true |
| 238 | + }, |
| 239 | + { |
| 240 | + "description": "object is valid", |
| 241 | + "data": {"foo": "bar"}, |
| 242 | + "valid": true |
| 243 | + }, |
| 244 | + { |
| 245 | + "description": "empty object is valid", |
| 246 | + "data": {}, |
| 247 | + "valid": true |
| 248 | + }, |
| 249 | + { |
| 250 | + "description": "array is valid", |
| 251 | + "data": ["foo"], |
| 252 | + "valid": true |
| 253 | + }, |
| 254 | + { |
| 255 | + "description": "empty array is valid", |
| 256 | + "data": [], |
| 257 | + "valid": true |
| 258 | + } |
| 259 | + ] |
| 260 | + }, |
| 261 | + { |
| 262 | + "description": "double negation", |
| 263 | + "schema": { |
| 264 | + "$schema": "https://json-schema.org/v1", |
| 265 | + "not": { "not": {} } |
| 266 | + }, |
119 | 267 | "tests": [ |
120 | 268 | { |
121 | 269 | "description": "any value is valid", |
|
0 commit comments