Skip to content

Commit 9cd1afd

Browse files
committed
Add "const" keyword for constant values.
This addresses issue #58, which got quite a few upvotes and has a "draft 6" milestone. I used the shorter "const" that several people suggested rather than "constant", but obviously that's easy to change if the longer form is preferred. The wording was pretty much directly lifted from "enum".
1 parent 4090d4c commit 9cd1afd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

jsonschema-validation.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,16 @@
547547
</t>
548548
</section>
549549

550+
<section title="const">
551+
<t>
552+
The value of this keyword MAY be of any type, including null.
553+
</t>
554+
<t>
555+
An instance validates successfully against this keyword if its value is
556+
equal to the value of the keyword.
557+
</t>
558+
</section>
559+
550560
<section title="type">
551561
<t>
552562
The value of this keyword MUST be either a string or an array. If it is

0 commit comments

Comments
 (0)