Skip to content

Commit 9da411f

Browse files
committed
test: add test for schema matching on propertyNames
1 parent 2aef107 commit 9da411f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/schema.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,6 +1790,10 @@ suite('JSON Schema', () => {
17901790
baz: {
17911791
type: 'boolean',
17921792
$comment: 'baz',
1793+
},
1794+
key: {
1795+
type: 'string',
1796+
$comment: 'key',
17931797
}
17941798
},
17951799
properties: {
@@ -1806,6 +1810,9 @@ suite('JSON Schema', () => {
18061810
}
18071811
}
18081812
}
1813+
},
1814+
propertyNames: {
1815+
$ref: "#/definitions/key"
18091816
}
18101817
};
18111818

@@ -1824,6 +1831,7 @@ suite('JSON Schema', () => {
18241831
assert.fail("No node at offset " + nodeOffset);
18251832
}
18261833
assertMatchingSchema(ms, 0, 'schema');
1834+
assertMatchingSchema(ms, 1, 'key');
18271835
assertMatchingSchema(ms, 7, 'foo');
18281836
assertMatchingSchema(ms, 14, 'bar');
18291837
assertMatchingSchema(ms, 22, 'baz');

0 commit comments

Comments
 (0)