|
68 | 68 | } |
69 | 69 | } |
70 | 70 | }, |
| 71 | + "purl_validation_message": { |
| 72 | + "title": "PURL validation message", |
| 73 | + "description": "Validation severity and message to use as a test expected output when validating a PURL.", |
| 74 | + "type": "object", |
| 75 | + "additionalProperties": false, |
| 76 | + "properties": { |
| 77 | + "severity": { |
| 78 | + "title": "Validation severity", |
| 79 | + "description": "Validation severity.", |
| 80 | + "type": "string", |
| 81 | + "enum": [ |
| 82 | + "info", |
| 83 | + "warning", |
| 84 | + "error" |
| 85 | + ], |
| 86 | + "meta:enum": { |
| 87 | + "info": "Informational validation message", |
| 88 | + "warning": "Warning validation message", |
| 89 | + "error": "Error validation message" |
| 90 | + } |
| 91 | + }, |
| 92 | + "message": { |
| 93 | + "title": "Validation message", |
| 94 | + "description": "Validation message.", |
| 95 | + "type": "string" |
| 96 | + } |
| 97 | + } |
| 98 | + }, |
71 | 99 | "purl_test": { |
72 | 100 | "title": "PURL test", |
73 | 101 | "description": "A PURL test with input and expected output.", |
|
128 | 156 | "string", |
129 | 157 | "null" |
130 | 158 | ] |
131 | | - }, |
132 | | - "expected_messages": { |
133 | | - "title": "Expected messages", |
134 | | - "description": "Validation messages expected for this test. Can be null or a list of strings.", |
135 | | - "default": null, |
136 | | - "type": ["null", "array"], |
137 | | - "items": { |
138 | | - "type": "string" |
139 | 159 | } |
140 | | - } |
141 | 160 | }, |
142 | 161 | "allOf": [ |
143 | 162 | { |
|
299 | 318 | { |
300 | 319 | "if": { |
301 | 320 | "properties": { |
302 | | - "test_type": { "const": "validation" } |
| 321 | + "test_type": { |
| 322 | + "const": "validation" |
| 323 | + } |
303 | 324 | }, |
304 | | - "required": ["test_type"] |
| 325 | + "required": [ |
| 326 | + "test_type" |
| 327 | + ] |
| 328 | + }, |
| 329 | + "then": { |
| 330 | + "properties": { |
| 331 | + "input": { |
| 332 | + "title": "Input test PURL", |
| 333 | + "description": "A PURL string to use as a test input (canonical or not).", |
| 334 | + "type": "string" |
| 335 | + }, |
| 336 | + "expected_output": { |
| 337 | + "title": "Expected validation messages and severities", |
| 338 | + "description": "List of validation objects with message and severity expected for this test. Can be an empty list.", |
| 339 | + "type": "array", |
| 340 | + "$ref": "#/definitions/purl_validation_message" |
| 341 | + } |
| 342 | + }, |
| 343 | + "required": [ |
| 344 | + "input", |
| 345 | + "expected_output" |
| 346 | + ] |
| 347 | + } |
| 348 | + }, |
| 349 | + { |
| 350 | + "if": { |
| 351 | + "properties": { |
| 352 | + "test_type": { |
| 353 | + "const": "validation" |
| 354 | + } |
| 355 | + }, |
| 356 | + "required": [ |
| 357 | + "test_type" |
| 358 | + ] |
305 | 359 | }, |
306 | 360 | "then": { |
307 | 361 | "properties": { |
|
314 | 368 | "title": "Expected messages", |
315 | 369 | "description": "Validation messages expected for this test. Can be null or a list of strings.", |
316 | 370 | "default": null, |
317 | | - "type": ["null", "array"], |
318 | | - "items": { "type": "string" } |
| 371 | + "type": [ |
| 372 | + "null", |
| 373 | + "array" |
| 374 | + ], |
| 375 | + "items": { |
| 376 | + "type": "string" |
| 377 | + } |
319 | 378 | } |
320 | 379 | }, |
321 | | - "required": ["input"] |
| 380 | + "required": [ |
| 381 | + "input" |
| 382 | + ] |
322 | 383 | } |
323 | 384 | } |
324 | 385 | ] |
|
0 commit comments