Debian Codegraph @

share/tests/v1/proposals/propertyDependencies/unevaluatedProperties.json

raw
1 [
2 {
3 "description": "unevaluatedProperties can see inside propertyDependencies",
4 "schema": {
5 "$schema": "https://json-schema.org/v1",
6 "properties": {
7 "foo": {
8 "type": "string"
9 }
10 },
11 "propertyDependencies": {
12 "foo": {
13 "foo1": {
14 "properties": {
15 "bar": true
16 }
17 }
18 }
19 },
20 "unevaluatedProperties": false
21 },
22 "tests": [
23 {
24 "description": "allows bar if foo = foo1",
25 "data": {
26 "foo": "foo1",
27 "bar": 42
28 },
29 "valid": true
30 },
31 {
32 "description": "disallows bar if foo != foo1",
33 "data": {
34 "foo": "foo2",
35 "bar": 42
36 },
37 "valid": false
38 },
39 {
40 "description": "disallows bar if foo is absent",
41 "data": {
42 "bar": 42
43 },
44 "valid": false
45 }
46 ]
47 },
48 {
49 "description": "propertyDependencies with unevaluatedProperties" ,
50 "schema" : {
51 "$schema": "https://json-schema.org/v1",
52 "properties" : {"foo2" : {}},
53 "propertyDependencies": {
54 "foo" : {},
55 "foo2": {
56 "bar": {
57 "properties": {
58 "buz": {}
59 }
60 }
61 }
62 },
63 "unevaluatedProperties": false
64 },
65
66 "tests": [
67 {
68 "description": "unevaluatedProperties doesn't consider propertyDependencies" ,
69 "data": {"foo": "bar"},
70 "valid": false
71 },
72 {
73 "description": "unevaluatedProperties sees buz when foo2 is present",
74 "data": {"foo2": "bar", "buz": ""},
75 "valid": true
76 },
77 {
78 "description": "unevaluatedProperties doesn't see buz when foo2 is absent",
79 "data": {"buz": ""},
80 "valid": false
81 }
82 ]
83 }
84 ]