Skip to content

Commit 457a2bd

Browse files
committed
test(draft2020-12): add boundary coverage for maxContains = 0
1 parent 583d7c6 commit 457a2bd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/draft2020-12/maxContains.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,25 @@
9898
"valid": false
9999
}
100100
]
101+
},
102+
{
103+
"description": "maxContains = 0 with contains",
104+
"schema": {
105+
"$schema": "https://json-schema.org/draft/2020-12/schema",
106+
"contains": {"const": 1},
107+
"maxContains": 0
108+
},
109+
"tests": [
110+
{
111+
"description": "empty array fails due to default minContains",
112+
"data": [ ],
113+
"valid": false
114+
},
115+
{
116+
"description": "array with matching element fails due to maxContains",
117+
"data": [ 1 ],
118+
"valid": false
119+
}
120+
]
101121
}
102122
]

0 commit comments

Comments
 (0)