Skip to content

Commit

Permalink
Add "const" keyword for constant values.
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
handrews committed Nov 8, 2016
1 parent 4090d4c commit 9cd1afd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions jsonschema-validation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,16 @@
</t>
</section>

<section title="const">
<t>
The value of this keyword MAY be of any type, including null.
</t>
<t>
An instance validates successfully against this keyword if its value is
equal to the value of the keyword.
</t>
</section>

<section title="type">
<t>
The value of this keyword MUST be either a string or an array. If it is
Expand Down

0 comments on commit 9cd1afd

Please sign in to comment.