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 16, 2016
1 parent b5afae7 commit a0c1e08
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 @@ -546,6 +546,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 a0c1e08

Please sign in to comment.