You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/2020-12/meta-data/examples.markdown
+42-66Lines changed: 42 additions & 66 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,93 +30,69 @@ related:
30
30
keyword: deprecated
31
31
---
32
32
33
-
The `examples` keyword is used to provide a list of example instances associated with a particular schema that should ideally validate against the schema. These examples serve to illustrate the intended structure and constraints defined by the schema. While these examples are not used for validation purposes, they are helpful in providing sample valid instances against the schema they are defined in.
34
33
35
-
_**Note:** While it is recommended that the examples validate against the subschema they are defined in, this requirement is not strictly enforced._
34
+
The `examples` keyword declares a set of example instances for a schema or any
35
+
of its subschemas, typically for documentation purposes. This keyword does not
36
+
affect validation, but the evaluator will collect its set of values as an
37
+
annotation.
36
38
37
-
* Used to demonstrate how data should conform to the schema.
38
-
*`examples` does not affect data validation but serves as an informative annotation.
39
+
{{<common-pitfall>}}
39
40
40
-
## Examples
41
+
Meta-schema validation will not check that the examples you declare are
42
+
actually valid against their respective schemas, as JSON Schema does not offer
43
+
a mechanism for meta-schemas to declare that instances validate against parts
44
+
of the same instance being evaluated. As a consequence, it is not rare for
45
+
schemas to declare invalid examples that go undetected for a long time.
0 commit comments