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/description.markdown
+59-60Lines changed: 59 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,90 +27,89 @@ related:
27
27
keyword: deprecated
28
28
---
29
29
30
-
The `description` keyword in JSON Schema is used to provide a human readable description for the schema. It does not affect data validation but serves as an informative annotation.
30
+
The `description` keyword is a placeholder for a longer human-readable string
31
+
summary of what a schema or any of its subschemas are about. This keyword does
32
+
not affect validation, but the evaluator will collect its value as an
33
+
annotation.
34
+
35
+
{{<best-practice>}}
36
+
37
+
We heavily recommend to declare this keyword at the top level of every schema,
38
+
as a human-readable longer description of what the schema is about.
39
+
Note that this keyword is meant to be to be used in conjunction with the
40
+
[`title`]({{< ref "2020-12/meta-data/title" >}}) keyword. The idea is to
41
+
augment the short summary with a longer description, and not to avoid the
42
+
concise summary altogether.
43
+
44
+
{{</best-practice>}}
45
+
46
+
{{<common-pitfall>}}
47
+
48
+
Tooling makers must be careful when statically traversing schemas in search of
49
+
occurences of this keyword. It is possible for schemas to make use of this
50
+
keyword behind conditional operators, references, or any other type of keyword
51
+
that makes it hard or even impossible to correctly locate these values without
52
+
fully evaluating the schema against an instance. The only bullet proof method
53
+
is through annotation collection.
54
+
55
+
{{</common-pitfall>}}
56
+
57
+
{{<metaschema-check-type `string`>}}
31
58
32
59
## Examples
33
60
34
-
{{<schema `Schema with 'description' keyword`>}}
61
+
{{<schema `A schema that declares a top level description alongside a short title`>}}
0 commit comments