Skip to content

Commit 8d08b9a

Browse files
committed
Add the "example" keyword.
This addresses issue #121. Most of the wording is lifted from "default", which is similar and can serve the same purpose. This wording explicitly allows for using "default" as an example which was not part of the original request but seems reasonable. Obviously, that part can be removed if deemed undesirable.
1 parent df8d370 commit 8d08b9a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

jsonschema-validation.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,25 @@
627627
</t>
628628
</section>
629629

630+
<section title='"example"'>
631+
<t>
632+
There are no restrictions placed on the value of this keyword.
633+
</t>
634+
<t>
635+
This keyword can be used to provide a sample JSON value associated with a
636+
particular schema, for the purpose of illustrating usage. It is
637+
RECOMMENDED that this value be valid against the associated schema.
638+
</t>
639+
<t>
640+
If this keyword is not present, but a "default" is specified,
641+
implementations MAY use the "default" value as if it were given
642+
as an example.
643+
</t>
644+
<t>
645+
This keyword MAY be used in root schemas, and in any subschemas.
646+
</t>
647+
</section>
648+
630649
</section>
631650

632651
<section title='Semantic validation with "format"'>

0 commit comments

Comments
 (0)