Skip to content

Commit d3c75a8

Browse files
committed
Clarify "targetSchema" and HTTP
"targetSchema" is often misinterpreted as a response schema, when it in fact is the representation of the target resource which may or may not appear in various responses. The previous draft clarified this somewhat by referencing GET responses and PUT requests. This separates the HTTP information from the field's primary definition, and expands it to the other relevant HTTP cases.
1 parent 1a0d1d2 commit d3c75a8

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

jsonschema-hyperschema.xml

+21-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<!ENTITY rfc3986 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3986.xml">
77
<!--<!ENTITY rfc4287 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4287.xml">-->
88
<!--<!ENTITY rfc5226 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5226.xml">-->
9+
<!ENTITY rfc5789 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5789.xml">
910
<!ENTITY rfc5988 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5988.xml">
1011
<!ENTITY rfc6570 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6570.xml">
1112
<!ENTITY rfc7231 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7231.xml">
@@ -703,9 +704,26 @@ GET /foo/
703704

704705
<section title="targetSchema">
705706
<t>
706-
This property provides a schema that is expected to describe the link target, including what a client can expect if it makes an HTTP GET request, and what it should send if it replaces the resource in an HTTP PUT request. The request structure for HTTP PATCH is described by the combination of this schema and the media type of the PATCH request payload. This property is advisory only.
707+
This property provides a schema that is expected to describe
708+
the link target's representation. Depending on the protocol,
709+
the schema may or may not describe the response to any particular
710+
request sent to the link. This property is advisory only.
707711
</t>
708-
712+
<section title="&quot;targetSchema&quot; and HTTP">
713+
<t>
714+
The relationship between a resource's representation and
715+
HTTP requests and responses is determined by
716+
<xref target="RFC7231">RFC 7231, section 4.3.1 - "GET", section 4.3.4 "PUT", and section 3.1.4.2, "Content-Location"</xref>.
717+
In particular, "targetSchema" suggests what a client can expect
718+
for the response to an HTTP GET or any response for which
719+
the "Content-Location" header is equal to the request URI,
720+
and what a client should send if it replaces the resource
721+
in an HTTP PUT request.
722+
Per <xref target="RFC5789">RFC 5789</xref>, the request structure
723+
for an HTTP PATCH is determined by the combination of "targetSchema"
724+
and the request media type.
725+
</t>
726+
</section>
709727
<section title="Security Considerations for &quot;targetSchema&quot;">
710728
<t>
711729
This property has similar security concerns to that of "mediaType".
@@ -950,6 +968,7 @@ GET /foo/
950968
<references title="Informative References">
951969
&rfc2046;
952970
<!--&rfc5226;-->
971+
&rfc5789;
953972
&rfc5988;
954973
&rfc7231;
955974
&html5;

0 commit comments

Comments
 (0)