Skip to content

Commit c4a99e0

Browse files
committed
move propertyDependencies tests to proposals folder
1 parent d69537a commit c4a99e0

File tree

7 files changed

+280
-274
lines changed

7 files changed

+280
-274
lines changed

tests/v1/additionalProperties.json

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -177,41 +177,6 @@
177177
}
178178
]
179179
},
180-
{
181-
"description": "propertyDependencies with additionalProperties",
182-
"schema": {
183-
"$schema": "https://json-schema.org/v1",
184-
"properties" : {"foo2" : {}},
185-
"propertyDependencies": {
186-
"foo" : {},
187-
"foo2": {
188-
"bar": {
189-
"properties": {
190-
"buz": {}
191-
}
192-
}
193-
}
194-
},
195-
"additionalProperties": false
196-
},
197-
"tests": [
198-
{
199-
"description": "additionalProperties doesn't consider propertyDependencies properties" ,
200-
"data": {"foo": ""},
201-
"valid": false
202-
},
203-
{
204-
"description": "additionalProperties can't see buz even when foo2 is present",
205-
"data": {"foo2": "bar", "buz": ""},
206-
"valid": false
207-
},
208-
{
209-
"description": "additionalProperties can't see buz",
210-
"data": {"buz": ""},
211-
"valid": false
212-
}
213-
]
214-
},
215180
{
216181
"description": "dependentSchemas with additionalProperties",
217182
"schema": {

tests/v1/dynamicRef.json

Lines changed: 0 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -123,83 +123,6 @@
123123
}
124124
]
125125
},
126-
{
127-
"description": "multiple dynamic paths to the $dynamicRef keyword",
128-
"schema": {
129-
"$schema": "https://json-schema.org/v1",
130-
"$id": "https://test.json-schema.org/dynamic-ref-with-multiple-paths/main",
131-
"propertyDependencies": {
132-
"kindOfList": {
133-
"numbers": { "$ref": "numberList" },
134-
"strings": { "$ref": "stringList" }
135-
}
136-
},
137-
"$defs": {
138-
"genericList": {
139-
"$id": "genericList",
140-
"properties": {
141-
"list": {
142-
"items": { "$dynamicRef": "#itemType" }
143-
}
144-
}
145-
},
146-
"numberList": {
147-
"$id": "numberList",
148-
"$defs": {
149-
"itemType": {
150-
"$dynamicAnchor": "itemType",
151-
"type": "number"
152-
}
153-
},
154-
"$ref": "genericList"
155-
},
156-
"stringList": {
157-
"$id": "stringList",
158-
"$defs": {
159-
"itemType": {
160-
"$dynamicAnchor": "itemType",
161-
"type": "string"
162-
}
163-
},
164-
"$ref": "genericList"
165-
}
166-
}
167-
},
168-
"tests": [
169-
{
170-
"description": "number list with number values",
171-
"data": {
172-
"kindOfList": "numbers",
173-
"list": [1.1]
174-
},
175-
"valid": true
176-
},
177-
{
178-
"description": "number list with string values",
179-
"data": {
180-
"kindOfList": "numbers",
181-
"list": ["foo"]
182-
},
183-
"valid": false
184-
},
185-
{
186-
"description": "string list with number values",
187-
"data": {
188-
"kindOfList": "strings",
189-
"list": [1.1]
190-
},
191-
"valid": false
192-
},
193-
{
194-
"description": "string list with string values",
195-
"data": {
196-
"kindOfList": "strings",
197-
"list": ["foo"]
198-
},
199-
"valid": true
200-
}
201-
]
202-
},
203126
{
204127
"description": "after leaving a dynamic scope, it is not used by a $dynamicRef",
205128
"schema": {
@@ -440,86 +363,6 @@
440363
}
441364
]
442365
},
443-
{
444-
"description": "$dynamicAnchor inside propertyDependencies",
445-
"schema": {
446-
"$schema": "https://json-schema.org/v1",
447-
"$id": "http://localhost:1234/v1/dynamicanchor-in-propertydependencies.json",
448-
"$defs": {
449-
"inner": {
450-
"$id": "inner",
451-
"$dynamicAnchor": "foo",
452-
"type": "object",
453-
"properties": {
454-
"expectedTypes": {
455-
"type": "string"
456-
}
457-
},
458-
"additionalProperties": {
459-
"$dynamicRef": "#foo"
460-
}
461-
}
462-
},
463-
"propertyDependencies": {
464-
"expectedTypes": {
465-
"strings": {
466-
"$id": "east",
467-
"$ref": "inner",
468-
"$defs": {
469-
"foo": {
470-
"$dynamicAnchor": "foo",
471-
"type": "string"
472-
}
473-
}
474-
},
475-
"integers": {
476-
"$id": "west",
477-
"$ref": "inner",
478-
"$defs": {
479-
"foo": {
480-
"$dynamicAnchor": "foo",
481-
"type": "integer"
482-
}
483-
}
484-
}
485-
}
486-
}
487-
},
488-
"tests": [
489-
{
490-
"description": "expected strings - additional property as string is valid",
491-
"data": {
492-
"expectedTypes": "strings",
493-
"anotherProperty": "also a string"
494-
},
495-
"valid": true
496-
},
497-
{
498-
"description": "expected strings - additional property as not string is invalid",
499-
"data": {
500-
"expectedTypes": "strings",
501-
"anotherProperty": 42
502-
},
503-
"valid": false
504-
},
505-
{
506-
"description": "expected integers - additional property as integer is valid",
507-
"data": {
508-
"expectedTypes": "integers",
509-
"anotherProperty": 42
510-
},
511-
"valid": true
512-
},
513-
{
514-
"description": "expected integers - additional property as not integer is invalid",
515-
"data": {
516-
"expectedTypes": "integers",
517-
"anotherProperty": "a string"
518-
},
519-
"valid": false
520-
}
521-
]
522-
},
523366
{
524367
"description": "$ref to $dynamicRef finds detached $dynamicAnchor",
525368
"schema": {
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[
2+
{
3+
"description": "propertyDependencies with additionalProperties",
4+
"schema": {
5+
"$schema": "https://json-schema.org/v1",
6+
"properties" : {"foo2" : {}},
7+
"propertyDependencies": {
8+
"foo" : {},
9+
"foo2": {
10+
"bar": {
11+
"properties": {
12+
"buz": {}
13+
}
14+
}
15+
}
16+
},
17+
"additionalProperties": false
18+
},
19+
"tests": [
20+
{
21+
"description": "additionalProperties doesn't consider propertyDependencies properties" ,
22+
"data": {"foo": ""},
23+
"valid": false
24+
},
25+
{
26+
"description": "additionalProperties can't see buz even when foo2 is present",
27+
"data": {"foo2": "bar", "buz": ""},
28+
"valid": false
29+
},
30+
{
31+
"description": "additionalProperties can't see buz",
32+
"data": {"buz": ""},
33+
"valid": false
34+
}
35+
]
36+
}
37+
]

0 commit comments

Comments
 (0)