1- # Annotation Tests
1+ # Annotations Tests Suite
22
3- The annotations Test Suite tests which annotations should appear (or not appear)
3+ The Annotations Test Suite tests which annotations should appear (or not appear)
44on which values of an instance. These tests are agnostic of any output format.
5+ Similar to the validation tests, they only test the end result and don't include
6+ details like mapping the annotation back to the schema location that contributed
7+ it. This Test Suite leaves those details to be tested by output format tests.
58
69## Supported Dialects
710
@@ -63,13 +66,13 @@ designed to work with as many releases as possible.
6366
6467### externalSchemas
6568
66- ` externalSchemas ` allows you to define additional schemas that ` schema ` makes
67- references to. The value is an object where the keys are retrieval URIs and
68- values are schemas. Most external schemas aren't self identifying (using
69- ` id ` / ` $id ` ) and rely on the retrieval URI for identification. This is done to
70- increase the number of dialects that the test is compatible with. Because ` id `
71- changed to ` $id ` in draft-06, if you use ` $id ` , the test becomes incompatible
72- with draft-03/4 and in most cases, that's not necessary.
69+ This allows you to define additional schemas that ` schema ` makes references to.
70+ The value is an object where the keys are retrieval URIs and values are schemas.
71+ Most external schemas aren't self identifying (using ` id ` / ` $id ` ) and rely on the
72+ retrieval URI for identification. This is done to increase the number of
73+ dialects that the test is compatible with. Because ` id ` changed to ` $id ` in
74+ draft-06, if you use ` $id ` , the test becomes incompatible with draft-03/4 and in
75+ most cases, that's not necessary.
7376
7477### tests
7578
@@ -83,7 +86,7 @@ The JSON instance to be annotated.
8386
8487### assertions
8588
86- ` assertions ` are a collection of assertions that must be true for the test to pass.
89+ A collection of assertions that must be true for the test to pass.
8790
8891## Assertions Components
8992
@@ -97,8 +100,10 @@ The annotating keyword.
97100
98101### expected
99102
100- An array of annotations on the ` keyword ` - instance ` location ` pair. ` expected `
101- is an array because there's always a chance that an annotation is applied
102- multiple times to any given instance location. The ` expected ` array should be
103- sorted such that the most recently encountered value for an annotation during
104- evaluation comes before previously encountered values.
103+ An array of ` keyword ` annotations expected on the instance at ` location ` .
104+ ` expected ` is an array because there's always a chance that an annotation is
105+ applied multiple times to any given instance location. Test runners can consider
106+ this an unordered list, but as a convention for this Test Suite, the ` expected `
107+ array should be sorted such that the most recently encountered value for an
108+ annotation given top-down evaluation of the schema comes before previously
109+ encountered values.
0 commit comments