Skip to content

Commit f4e41b0

Browse files
authored
Merge pull request #785 from jdesrosiers/uneval-nested-conflicts
Add tests for evaluated property nesting conflicts
2 parents 60a2633 + 8970b1c commit f4e41b0

File tree

6 files changed

+147
-0
lines changed

6 files changed

+147
-0
lines changed

tests/draft-next/unevaluatedItems.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,5 +819,30 @@
819819
}
820820

821821
]
822+
},
823+
{
824+
"description": "Evaluated items collection needs to consider instance location",
825+
"schema": {
826+
"$schema": "https://json-schema.org/draft/next/schema",
827+
"prefixItems": [
828+
{
829+
"prefixItems": [
830+
true,
831+
{ "type": "string" }
832+
]
833+
}
834+
],
835+
"unevaluatedItems": false
836+
},
837+
"tests": [
838+
{
839+
"description": "with an unevaluated item that exists at another location",
840+
"data": [
841+
["foo", "bar"],
842+
"bar"
843+
],
844+
"valid": false
845+
}
846+
]
822847
}
823848
]

tests/draft-next/unevaluatedProperties.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,5 +1670,29 @@
16701670
"valid": true
16711671
}
16721672
]
1673+
},
1674+
{
1675+
"description": "Evaluated properties collection needs to consider instance location",
1676+
"schema": {
1677+
"$schema": "https://json-schema.org/draft/next/schema",
1678+
"properties": {
1679+
"foo": {
1680+
"properties": {
1681+
"bar": { "type": "string" }
1682+
}
1683+
}
1684+
},
1685+
"unevaluatedProperties": false
1686+
},
1687+
"tests": [
1688+
{
1689+
"description": "with an unevaluated property that exists at another location",
1690+
"data": {
1691+
"foo": { "bar": "foo" },
1692+
"bar": "bar"
1693+
},
1694+
"valid": false
1695+
}
1696+
]
16731697
}
16741698
]

tests/draft2019-09/unevaluatedItems.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,5 +699,30 @@
699699
}
700700

701701
]
702+
},
703+
{
704+
"description": "Evaluated items collection needs to consider instance location",
705+
"schema": {
706+
"$schema": "https://json-schema.org/draft/2019-09/schema",
707+
"items": [
708+
{
709+
"items": [
710+
true,
711+
{ "type": "string" }
712+
]
713+
}
714+
],
715+
"unevaluatedItems": false
716+
},
717+
"tests": [
718+
{
719+
"description": "with an unevaluated item that exists at another location",
720+
"data": [
721+
["foo", "bar"],
722+
"bar"
723+
],
724+
"valid": false
725+
}
726+
]
702727
}
703728
]

tests/draft2019-09/unevaluatedProperties.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,5 +1598,29 @@
15981598
"valid": true
15991599
}
16001600
]
1601+
},
1602+
{
1603+
"description": "Evaluated properties collection needs to consider instance location",
1604+
"schema": {
1605+
"$schema": "https://json-schema.org/draft/2019-09/schema",
1606+
"properties": {
1607+
"foo": {
1608+
"properties": {
1609+
"bar": { "type": "string" }
1610+
}
1611+
}
1612+
},
1613+
"unevaluatedProperties": false
1614+
},
1615+
"tests": [
1616+
{
1617+
"description": "with an unevaluated property that exists at another location",
1618+
"data": {
1619+
"foo": { "bar": "foo" },
1620+
"bar": "bar"
1621+
},
1622+
"valid": false
1623+
}
1624+
]
16011625
}
16021626
]

tests/draft2020-12/unevaluatedItems.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,5 +825,30 @@
825825
"valid": false
826826
}
827827
]
828+
},
829+
{
830+
"description": "Evaluated items collection needs to consider instance location",
831+
"schema": {
832+
"$schema": "https://json-schema.org/draft/2020-12/schema",
833+
"prefixItems": [
834+
{
835+
"prefixItems": [
836+
true,
837+
{ "type": "string" }
838+
]
839+
}
840+
],
841+
"unevaluatedItems": false
842+
},
843+
"tests": [
844+
{
845+
"description": "with an unevaluated item that exists at another location",
846+
"data": [
847+
["foo", "bar"],
848+
"bar"
849+
],
850+
"valid": false
851+
}
852+
]
828853
}
829854
]

tests/draft2020-12/unevaluatedProperties.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,5 +1585,29 @@
15851585
"valid": true
15861586
}
15871587
]
1588+
},
1589+
{
1590+
"description": "Evaluated properties collection needs to consider instance location",
1591+
"schema": {
1592+
"$schema": "https://json-schema.org/draft/2020-12/schema",
1593+
"properties": {
1594+
"foo": {
1595+
"properties": {
1596+
"bar": { "type": "string" }
1597+
}
1598+
}
1599+
},
1600+
"unevaluatedProperties": false
1601+
},
1602+
"tests": [
1603+
{
1604+
"description": "with an unevaluated property that exists at another location",
1605+
"data": {
1606+
"foo": { "bar": "foo" },
1607+
"bar": "bar"
1608+
},
1609+
"valid": false
1610+
}
1611+
]
15881612
}
15891613
]

0 commit comments

Comments
 (0)