Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the "example" keyword. #123

Merged
merged 1 commit into from
Nov 21, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions jsonschema-validation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -666,9 +666,6 @@
preferably be short, whereas a description will provide explanation about
the purpose of the instance described by this schema.
</t>
<t>
Both of these keywords MAY be used in root schemas, and in any subschemas.
</t>
</section>

<section title='"default"'>
Expand All @@ -680,8 +677,22 @@
particular schema. It is RECOMMENDED that a default value be valid against
the associated schema.
</t>
</section>

<section title='"examples"'>
<t>
The value of this keyword MUST be an array.
There are no restrictions placed on the values within the array.
</t>
<t>
This keyword can be used to provide sample JSON values associated with a
particular schema, for the purpose of illustrating usage. It is
RECOMMENDED that these values be valid against the associated schema.
</t>
<t>
This keyword MAY be used in root schemas, and in any subschemas.
Implementations MAY use the value of "default", if present, as
an additional example. If "examples" is absent, "default"
MAY still be used in this manner.
</t>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RECOMMENDED that these values be valid against the associated schema.

I think it should be "MUST BE".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was discussed (for default and examples) in #125, and we decided not to change the approach.

</section>

Expand Down