Skip to content

Commit

Permalink
Squashed 'json/' changes from 878b0ad5f..eb619047f
Browse files Browse the repository at this point in the history
eb619047f Merge pull request #504 from json-schema-org/minContains-0-but-maxContains
c41a68e83 Add tests for minContains = 0 but with maxContains

git-subtree-dir: json
git-subtree-split: eb619047f145de038d60e1ded4b7957d4fe6bd2f
  • Loading branch information
Julian committed Aug 18, 2021
1 parent 0fe6d84 commit 2591383
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
25 changes: 25 additions & 0 deletions tests/draft-future/minContains.json
Expand Up @@ -168,5 +168,30 @@
"valid": true
}
]
},
{
"description": "minContains = 0 with maxContains",
"schema": {
"contains": {"const": 1},
"minContains": 0,
"maxContains": 1
},
"tests": [
{
"description": "empty data",
"data": [ ],
"valid": true
},
{
"description": "not more than maxContains",
"data": [ 1 ],
"valid": true
},
{
"description": "too many",
"data": [ 1, 1 ],
"valid": false
}
]
}
]
27 changes: 26 additions & 1 deletion tests/draft2019-09/minContains.json
Expand Up @@ -151,7 +151,7 @@
]
},
{
"description": "minContains = 0",
"description": "minContains = 0 with no maxContains",
"schema": {
"contains": {"const": 1},
"minContains": 0
Expand All @@ -168,5 +168,30 @@
"valid": true
}
]
},
{
"description": "minContains = 0 with maxContains",
"schema": {
"contains": {"const": 1},
"minContains": 0,
"maxContains": 1
},
"tests": [
{
"description": "empty data",
"data": [ ],
"valid": true
},
{
"description": "not more than maxContains",
"data": [ 1 ],
"valid": true
},
{
"description": "too many",
"data": [ 1, 1 ],
"valid": false
}
]
}
]
25 changes: 25 additions & 0 deletions tests/draft2020-12/minContains.json
Expand Up @@ -168,5 +168,30 @@
"valid": true
}
]
},
{
"description": "minContains = 0 with maxContains",
"schema": {
"contains": {"const": 1},
"minContains": 0,
"maxContains": 1
},
"tests": [
{
"description": "empty data",
"data": [ ],
"valid": true
},
{
"description": "not more than maxContains",
"data": [ 1 ],
"valid": true
},
{
"description": "too many",
"data": [ 1, 1 ],
"valid": false
}
]
}
]

0 comments on commit 2591383

Please sign in to comment.