|
392 | 392 | "schema": {
|
393 | 393 | "$schema": "https://json-schema.org/draft/2020-12/schema",
|
394 | 394 | "$id": "https://test.json-schema.org/dynamic-ref-with-multiple-paths/main",
|
395 |
| - "$defs": { |
396 |
| - "inner": { |
397 |
| - "$id": "inner", |
398 |
| - "$dynamicAnchor": "foo", |
399 |
| - "title": "inner", |
400 |
| - "additionalProperties": { |
401 |
| - "$dynamicRef": "#foo" |
402 |
| - } |
403 |
| - } |
404 |
| - }, |
405 | 395 | "if": {
|
406 | 396 | "propertyNames": {
|
407 | 397 | "pattern": "^[a-m]"
|
408 | 398 | }
|
409 | 399 | },
|
410 | 400 | "then": {
|
411 |
| - "title": "any type of node", |
412 |
| - "$id": "anyLeafNode", |
413 |
| - "$dynamicAnchor": "foo", |
| 401 | + "$id": "numberValues", |
| 402 | + "$defs": { |
| 403 | + "foo": { |
| 404 | + "$dynamicAnchor": "foo", |
| 405 | + "type": "number" |
| 406 | + } |
| 407 | + }, |
414 | 408 | "$ref": "inner"
|
415 | 409 | },
|
416 | 410 | "else": {
|
417 |
| - "title": "integer node", |
418 |
| - "$id": "integerNode", |
419 |
| - "$dynamicAnchor": "foo", |
420 |
| - "type": [ "object", "integer" ], |
| 411 | + "$id": "stringValues", |
| 412 | + "$defs": { |
| 413 | + "foo": { |
| 414 | + "$dynamicAnchor": "foo", |
| 415 | + "type": "string" |
| 416 | + } |
| 417 | + }, |
421 | 418 | "$ref": "inner"
|
| 419 | + }, |
| 420 | + "$defs": { |
| 421 | + "inner": { |
| 422 | + "$id": "inner", |
| 423 | + "$dynamicAnchor": "foo", |
| 424 | + "additionalProperties": { |
| 425 | + "$dynamicRef": "#foo" |
| 426 | + } |
| 427 | + } |
422 | 428 | }
|
423 | 429 | },
|
424 | 430 | "tests": [
|
425 | 431 | {
|
426 |
| - "description": "recurse to anyLeafNode - floats are allowed", |
| 432 | + "description": "alpha with number values", |
427 | 433 | "data": { "alpha": 1.1 },
|
428 | 434 | "valid": true
|
429 | 435 | },
|
430 | 436 | {
|
431 |
| - "description": "recurse to integerNode - floats are not allowed", |
| 437 | + "description": "alpha with string values", |
| 438 | + "data": { "alpha": "foo" }, |
| 439 | + "valid": false |
| 440 | + }, |
| 441 | + { |
| 442 | + "description": "november with number values", |
432 | 443 | "data": { "november": 1.1 },
|
433 | 444 | "valid": false
|
| 445 | + }, |
| 446 | + { |
| 447 | + "description": "november with string values", |
| 448 | + "data": { "november": "foo" }, |
| 449 | + "valid": true |
434 | 450 | }
|
435 | 451 | ]
|
436 | 452 | },
|
|
0 commit comments