Skip to content

Commit f55b4c2

Browse files
committed
Added test for additional properties looking in applicator keywords
1 parent 8c3d56d commit f55b4c2

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

tests/draft4/additionalProperties.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,21 @@
113113
"valid": true
114114
}
115115
]
116+
},
117+
{
118+
"description": "additionalProperties should not look in applicators",
119+
"schema": {
120+
"allOf": [
121+
{"properties": {"foo": {}}}
122+
],
123+
"additionalProperties": {"type": "boolean"}
124+
},
125+
"tests": [
126+
{
127+
"description": "properties defined in allOf are not allowed",
128+
"data": {"foo": 1, "bar": true},
129+
"valid": false
130+
}
131+
]
116132
}
117133
]

tests/draft6/additionalProperties.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,21 @@
113113
"valid": true
114114
}
115115
]
116+
},
117+
{
118+
"description": "additionalProperties should not look in applicators",
119+
"schema": {
120+
"allOf": [
121+
{"properties": {"foo": {}}}
122+
],
123+
"additionalProperties": {"type": "boolean"}
124+
},
125+
"tests": [
126+
{
127+
"description": "properties defined in allOf are not allowed",
128+
"data": {"foo": 1, "bar": true},
129+
"valid": false
130+
}
131+
]
116132
}
117133
]

tests/draft7/additionalProperties.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,21 @@
113113
"valid": true
114114
}
115115
]
116+
},
117+
{
118+
"description": "additionalProperties should not look in applicators",
119+
"schema": {
120+
"allOf": [
121+
{"properties": {"foo": {}}}
122+
],
123+
"additionalProperties": {"type": "boolean"}
124+
},
125+
"tests": [
126+
{
127+
"description": "properties defined in allOf are not allowed",
128+
"data": {"foo": 1, "bar": true},
129+
"valid": false
130+
}
131+
]
116132
}
117133
]

0 commit comments

Comments
 (0)