|
351 | 351 | specified in [RFC3986].
|
352 | 352 | </t>
|
353 | 353 | <t>
|
354 |
| - The value for this keyword MUST be a string, and MUST be a valid <xref target="RFC3986">URI-reference</xref>. |
355 |
| - This URI SHOULD be normalized, and SHOULD NOT be an empty fragment (#) or the empty string. |
| 354 | + The value for this keyword MUST be a string, and MUST represent a valid <xref target="RFC3986">URI-reference</xref>. |
| 355 | + This URI SHOULD be normalized, and SHOULD NOT be an empty fragment <#> or an empty string ><. |
356 | 356 | </t>
|
357 | 357 | <t>
|
358 |
| - The outermost schema of a JSON Schema document SHOULD be an absolute-URI (containing a scheme, but no fragment). |
| 358 | + The root schema of a JSON Schema document SHOULD specify an absolute-URI "id" (containing a scheme, but no fragment). |
359 | 359 | </t>
|
360 | 360 | <t>
|
361 | 361 | To identify a particular subschema in a document without needing a JSON Pointer,
|
|
404 | 404 | <t hangText="#/definitions/schema3">urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f</t>
|
405 | 405 | </list>
|
406 | 406 | </t>
|
407 |
| - <section title="Methods for dereferencing"> |
| 407 | + <section title="Inline references"> |
408 | 408 | <t>
|
409 | 409 | Schemas can be identified by any URI that has been given to them, including a JSON Pointer or
|
410 | 410 | their URI given directly by "id".
|
411 | 411 | </t>
|
412 | 412 | <t>
|
413 |
| - When resolving a URI to obtain a schema, tools MUST support the lookup of documents based on this URI, and the use of JSON Pointer fragments to locate particular locations within a schema document. |
414 |
| - </t> |
415 |
| - <t> |
416 |
| - Tools MAY also take note of the URIs schemas provide for themselves using "id", and use these values for schema dereferencing as well. |
| 413 | + Tools SHOULD take note of the URIs that schemas, including subschemas, provide for themselves using "id". |
417 | 414 | This is known as "inline referencing".
|
418 | 415 | </t>
|
419 | 416 |
|
|
441 | 438 | </artwork>
|
442 | 439 | </figure>
|
443 | 440 | <t>
|
444 |
| - When an implementation encounters the "schema1" schema, it resolves the "id" URI reference |
| 441 | + When an implementation encounters the <schema1> schema, it resolves the "id" URI reference |
445 | 442 | against the current base URI, resolving to <http://example.net/schema1>.
|
446 | 443 | </t>
|
447 | 444 | <t>
|
448 |
| - When an implementation then looks inside the "schema2" schema, it encounters the "schema1" reference, |
449 |
| - and resolves this the URI <http://example.net/schema1> which is understood as a schema defined elsewhere in the document. |
| 445 | + When an implementation then looks inside the <schema2> schema, it encounters the <schema1> reference, |
| 446 | + and resolves this the URI <http://example.net/schema1> which is understood as the schema defined elsewhere in the same document. |
450 | 447 | </t>
|
451 | 448 | <figure>
|
452 | 449 | <preamble>
|
|
468 | 465 | </artwork>
|
469 | 466 | </figure>
|
470 | 467 | </section>
|
| 468 | + <section title="External references"> |
| 469 | + <t> |
| 470 | + To differentiate schemas between each other in a vast ecosystem, schemas are identified by URI. |
| 471 | + As specified above, this does not necessarially mean anything is downloaded, but instead JSON Schema |
| 472 | + implementations SHOULD provide ways to import a schema so that other schemas can reference it. |
| 473 | + </t> |
| 474 | + <t> |
| 475 | + Implementations SHOULD be able to associate arbritrary URIs with an arbritrary schema and/or |
| 476 | + automatically associate a schema's "id"-given URI, depending on the trust that the the validator |
| 477 | + has in the schema. |
| 478 | + </t> |
| 479 | + <t> |
| 480 | + A schema may have multiple URIs, but a URI must identify not more than one schema. |
| 481 | + Validators that try to have multiple schemas associated to the same URI SHOULD raise an error condition. |
| 482 | + </t> |
| 483 | + </section> |
471 | 484 | </section>
|
472 | 485 | </section>
|
473 | 486 |
|
|
0 commit comments