Skip to content

Commit 851daec

Browse files
committed
Update/clean up wording for "id" section
1 parent 83a7a1b commit 851daec

File tree

1 file changed

+15
-23
lines changed

1 file changed

+15
-23
lines changed

jsonschema-core.xml

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -401,37 +401,29 @@
401401

402402
<section title="Valid values">
403403
<t>
404-
The value for this keyword MUST be a string, and MUST be a valid URI reference.
404+
The value for this keyword MUST be a string, and MUST be a valid URI-reference [RFC3986].
405405
This URI SHOULD be normalized, and SHOULD NOT be an empty fragment (#) or the empty string.
406406
</t>
407407
</section>
408408

409409
<section title="Usage">
410410
<t>
411-
The "id" keyword is used to give the document a URI and set its base URI for resolving URI references against.
412-
When an id is encountered, an implementation MUST resolve this id against
413-
the parent environment base URI. The resolved URI will be the new base URI for
414-
the rest of the schema and all child schemas, until another "id" is encountered.
411+
The "id" keyword defines the URI of the schema and the base URI that other URI references within
412+
the schema are resolved against. The "id" keyword itself is resolved against a base URI as
413+
specified in [RFC3986].
415414
</t>
416-
417415
<t>
418-
When using "id" to alter the base URI, schema authors SHOULD ensure
419-
that the URI is unique within the schema.
416+
The outermost schema of a JSON Schema document SHOULD be an absolute-URI (containing a scheme, but no fragment)
417+
or an absolute-URI with an empty fragment.
420418
</t>
421-
422419
<t>
423-
This schema will be taken as an example:
420+
For example:
424421
</t>
425-
426-
<!--
427-
FIXME: http again as a scheme, maybe another one? It can be any scheme after
428-
all
429-
-->
430422
<figure>
431423
<artwork>
432424
<![CDATA[
433425
{
434-
"id": "http://x.y.z/rootschema.json#",
426+
"id": "http://example.com/rootschema.json#",
435427
"schema1": {
436428
"id": "#foo"
437429
},
@@ -445,7 +437,7 @@
445437
}
446438
},
447439
"schema3": {
448-
"id": "some://where.else/completely#"
440+
"id": "urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f"
449441
}
450442
}
451443
]]>
@@ -458,12 +450,12 @@
458450
base URIs:
459451

460452
<list style="hanging">
461-
<t hangText="# (document root)">http://x.y.z/rootschema.json#</t>
462-
<t hangText="#/schema1">http://x.y.z/rootschema.json#foo</t>
463-
<t hangText="#/schema2">http://x.y.z/otherschema.json#</t>
464-
<t hangText="#/schema2/nested">http://x.y.z/otherschema.json#bar</t>
465-
<t hangText="#/schema2/alsonested">http://x.y.z/t/inner.json#a</t>
466-
<t hangText="#/schema3">some://where.else/completely#</t>
453+
<t hangText="# (document root)">http://example.com/rootschema.json#</t>
454+
<t hangText="#/schema1">http://example.com/rootschema.json#foo</t>
455+
<t hangText="#/schema2">http://example.com/otherschema.json#</t>
456+
<t hangText="#/schema2/nested">http://example.com/otherschema.json#bar</t>
457+
<t hangText="#/schema2/alsonested">http://example.com/t/inner.json#a</t>
458+
<t hangText="#/schema3">urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f</t>
467459
</list>
468460
</t>
469461

0 commit comments

Comments
 (0)