Skip to content

Commit 9f28800

Browse files
committed
Fix parent link example.
This addresses issue json-schema-org#97, where it was noted that "The only interpretation that makes sense is it's providing an array of instances, each can be described by the schema." This makes the schema an array schema, and replaces the "self" link with the more correct (or at least less confusing in this context) "item" link. Also fix a "the the" typo in the security considerations section, and make "hyper-schema" consistent.
1 parent 4090d4c commit 9f28800

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

jsonschema-hyperschema.xml

+14-11
Original file line numberDiff line numberDiff line change
@@ -514,16 +514,19 @@
514514
</t>
515515

516516
<figure>
517-
<preamble>For example, if a schema is defined:</preamble>
517+
<preamble>For example, if a hyper-schema is defined:</preamble>
518518
<artwork>
519519
<![CDATA[{
520-
"links": [{
521-
"rel": "self",
522-
"href": "{id}"
523-
}, {
524-
"rel": "up",
525-
"href": "{upId}"
526-
}]
520+
"type": "array",
521+
"items": {
522+
"links": [{
523+
"rel": "item",
524+
"href": "{id}"
525+
}, {
526+
"rel": "up",
527+
"href": "{upId}"
528+
}]
529+
}
527530
}]]>
528531
</artwork>
529532
</figure>
@@ -542,7 +545,7 @@
542545
}]]]>
543546
</artwork>
544547
<postamble>
545-
This would indicate that for the first item in the collection, its own (self) URI would resolve to "/Resource/thing" and the first item's "up" relation SHOULD be resolved to the resource at "/Resource/parent".
548+
This would indicate that for the first item in the collection, its URI as its own resource would resolve to "/Resource/thing" and the first item's "up" relation SHOULD be resolved to the resource at "/Resource/parent".
546549
</postamble>
547550
</figure>
548551

@@ -552,10 +555,10 @@
552555

553556
<section title="Security Considerations for &quot;self&quot; links">
554557
<t>
555-
When link relation of "self" is used to denote a full representation of an object, the user agent SHOULD NOT consider the representation to be the authoritative representation of the resource denoted by the target URI if the target URI is not equivalent to or a sub-path of the the URI used to request the resource representation which contains the target URI with the "self" link.
558+
When link relation of "self" is used to denote a full representation of an object, the user agent SHOULD NOT consider the representation to be the authoritative representation of the resource denoted by the target URI if the target URI is not equivalent to or a sub-path of the URI used to request the resource representation which contains the target URI with the "self" link.
556559

557560
<figure>
558-
<preamble>For example, if a hyper schema was defined:</preamble>
561+
<preamble>For example, if a hyper-schema was defined:</preamble>
559562
<artwork>
560563
<![CDATA[{
561564
"links": [{

0 commit comments

Comments
 (0)