Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 11a0063

Browse files
committed
Schema: rewrite sections for clarity
1 parent 4c25c97 commit 11a0063

File tree

2 files changed

+28
-55
lines changed

2 files changed

+28
-55
lines changed

‎jsonschema-core.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ User-Agent: so-cool-json-schema/1.0.2 curl/7.43.0
563563

564564
<section title='Linking to a schema'>
565565
<t>
566-
It is RECOMMENDED that instances link to a downloadable JSON Schema using the link relation "describedby", as defined by <xref target="W3C.REC-ldp-20150226">Linked Data Protocol 1.0, section 8.1</xref>.
566+
It is RECOMMENDED that instances described by a schema/profile provide a link to a downloadable JSON Schema using the link relation "describedby", as defined by <xref target="W3C.REC-ldp-20150226">Linked Data Protocol 1.0, section 8.1</xref>.
567567
</t>
568568

569569
<t>
@@ -703,7 +703,7 @@ Link: </alice>; rel="profile", </bob>; rel="profile"
703703
<date year="2013" month="January"/>
704704
</front>
705705
</reference>
706-
<reference anchor="json-hyper-schema"
706+
<reference anchor="json-hyper-schema"
707707
target="http://tools.ietf.org/html/draft-luff-json-hyper-schema-01">
708708
<front>
709709
<title>JSON Hyper-Schema: Hypertext definitions for JSON Schema</title>

‎jsonschema-schema.xml‎

Lines changed: 26 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,9 @@
6363

6464
<abstract>
6565
<t>
66-
JSON Schema (application/schema+json) has several purposes, one of which is instance
67-
validation. The validation process may be interactive or non-interactive. For
68-
instance, applications may use JSON Schema to build a user interface enabling
69-
interactive content generation in addition to user input checking, or validate data
70-
retrieved from various sources. This specification describes schema keywords
71-
dedicated to validation purposes.
66+
JSON Schema (application/schema+json) has several purposes, one of which is JSON instance
67+
validation. This document specifies a vocabulary for JSON Schema to makes assertions about
68+
valid instances.
7269
</t>
7370
</abstract>
7471
</front>
@@ -77,17 +74,14 @@
7774
<section title="Introduction">
7875
<t>
7976
JSON Schema can be used to require that a given JSON document (an instance)
80-
satisfies a certain number of criteria. These criteria are materialized by a set of
81-
keywords which are described in this specification. In addition, a set of keywords
82-
is defined to assist in interactive instance generation. Those are also described in
83-
this specification.
77+
satisfies a certain number of criteria. These criteria are asserted by using
78+
keywords described in this specification. In addition, a set of keywords
79+
is also defined to assist in interactive, user interface instance generation.
8480
</t>
85-
8681
<t>
87-
This specification will use the terminology defined by the JSON Schema core
88-
specification. It is advised that readers have a copy of this specification.
82+
This specification will use the terminology defined by the
83+
<xreftarget="json-schema-core">JSON Schema core</xref> specification.
8984
</t>
90-
9185
</section>
9286

9387
<section title="Conventions and Terminology">
@@ -99,19 +93,16 @@
9993
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
10094
interpreted as described in <xref target="RFC2119">RFC 2119</xref>.
10195
</t>
102-
10396
<t>
10497
This specification uses the term "container instance" to refer to both array and
10598
object instances. It uses the term "children instances" to refer to array elements
10699
or object member values.
107100
</t>
108-
109101
<t>
110102
This specification uses the term "property set" to refer to the set of an object's
111103
member names; for instance, the property set of JSON Object { "a": 1, "b": 2 } is [
112104
"a", "b" ].
113105
</t>
114-
115106
<t>
116107
Elements in an array value are said to be unique if no two elements of this array
117108
are equal, as defined by the core specification.
@@ -121,36 +112,29 @@
121112
<section title="Interoperability considerations">
122113

123114
<section title="Validation of string instances">
124-
125115
<t>
126-
It should be noted that the nul character (\x00) is valid in a JSON string. An
116+
It should be noted that the nul character (\u0000) is valid in a JSON string. An
127117
instance to validate may contain a string value with this character, regardless
128118
of the ability of the underlying programming language to deal with such data.
129119
</t>
130-
131120
</section>
132121

133122
<section title="Validation of numeric instances">
134-
135123
<t>
136-
The JSON specification does not define any bounds to the scale or precision of
137-
numeric values. JSON Schema does not define any such bounds either. This means
138-
that numeric instances processed by JSON Schema can be arbitrarily large and/or
124+
The JSON specification allows numbers with arbritrary prevision, and JSON Schema does not add any such bounds.
125+
This means that numeric instances processed by JSON Schema can be arbitrarily large and/or
139126
have an arbitrarily large decimal part, regardless of the ability of the
140127
underlying programming language to deal with such data.
141128
</t>
142-
143129
</section>
144130

145131
<section title="Regular expressions">
146-
147132
<t>
148133
Two validation keywords, "pattern" and "patternProperties", use regular
149134
expressions to express constraints. These regular expressions SHOULD
150135
be valid according to the <xref target="ecma262">ECMA 262</xref> regular
151136
expression dialect.
152137
</t>
153-
154138
<t>
155139
Furthermore, given the high disparity in regular expression constructs support,
156140
schema authors SHOULD limit themselves to the following regular expression
@@ -170,13 +154,11 @@
170154
<t>simple grouping ("(...)") and alternation ("|").</t>
171155
</list>
172156
</t>
173-
174157
<t>
175158
Finally, implementations MUST NOT consider that regular expressions are
176159
anchored, neither at the beginning nor at the end. This means, for instance,
177160
that "es" matches "expression".
178161
</t>
179-
180162
</section>
181163

182164
</section>
@@ -185,37 +167,21 @@
185167

186168
<section title="Keywords and instance primitive types">
187169
<t>
188-
Some validation keywords only apply to one or more primitive types. When the
189-
primitive type of the instance cannot be validated by a given keyword,
190-
validation for this keyword and instance SHOULD succeed.
170+
Most validation keywords only limit the range of values within a certain primitive type.
171+
When the primitive type of the instance is not of the type targeted by the keyword, the
172+
validation succeeds.
191173
</t>
192174
<t>
193-
This specification groups keywords in different sections, according to the
194-
primitive type, or types, these keywords validate. Note that some keywords
195-
validate all instance types.
175+
For example, the "maxLength" keyword will only restrict certain strings that are too long from being valid.
176+
If the instance is a number, boolean, null, array, or object, the keyword passes validation.
196177
</t>
197178
</section>
198179

199180
<section title="Default values for missing keywords">
200181
<t>
201-
Some keywords, if absent, MAY be regarded by implementations as having
202-
a default value. In this case, the default value will be mentioned.
203-
</t>
204-
</section>
205-
206-
<section title="Validation of container instances">
207-
<t>
208-
Keywords with the possibility to validate container instances (arrays or
209-
objects) only validate the instances themselves and not their children (array
210-
items or object properties). Some of these keywords do, however, contain
211-
information which is necessary for calculating which schema(s) a child must be
212-
valid against. The algorithms to calculate a child instance's relevant schema(s)
213-
are explained in a separate section.
214-
</t>
215-
<t>
216-
It should be noted that while an array element will only have to validate
217-
against one schema, object member values may have to validate against more than
218-
one schema.
182+
Validation keywords that are missing never restrict validation.
183+
In some cases, this behavior is identical to certain values that also are no-op.
184+
Since these values can be safely ignored or removed, they are noted where known.
219185
</t>
220186
</section>
221187

@@ -790,6 +756,13 @@
790756
<!-- References Section -->
791757
<references title="Normative References">
792758
&RFC2119;
759+
<reference anchor="json-schema-core">
760+
<front>
761+
<title>JSON Schema: core definitions and terminology</title>
762+
<author/>
763+
<date year="2016" month="September"/>
764+
</front>
765+
</reference>
793766
</references>
794767

795768
<references title="Informative References">

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /