Skip to content

Commit f8d006d

Browse files
committed
"method" does not constrain HTTP methods
"method" already documented that "method": "get" does not constrain the LDO to GET. Clarify that "post" also does not constrain the LDO to HTTP POST, and that the LDO can be used with multiple methods. The "schema" and "targetSchema" keywords are used with relevant HTTP methods regardless of the presence, absence, or value of JSON Hyper-Schema LDO "method". This is consistent with the existing wording of both "schema" and "targetSchema" around the construction of PUT requests.
1 parent 6c3df61 commit f8d006d

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

jsonschema-hyperschema.xml

+12-3
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ GET /foo/
701701
</t>
702702
</section>
703703

704-
<section title="targetSchema">
704+
<section title="targetSchema" anchor="targetSchema">
705705
<t>
706706
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. This property is advisory only.
707707
</t>
@@ -855,11 +855,20 @@ GET /foo/
855855
This property specifies that the client can construct a templated query or non-idempotent request to a resource.
856856
</t>
857857
<t>
858-
If "method" is "get", the link identifies how a user can compute the URI of an arbitrary resource. For example, how to compute a link to a page of search results relating to the instance, for a user-selected query term. Despite being named after GET, there is no constraint on the method or protocol used to interact with the remote resource.
858+
If "method" is "get", the link identifies how a user can compute the URI of an arbitrary resource. For example, how to compute a link to a page of search results relating to the instance, for a user-selected query term.
859859
</t>
860860
<t>
861861
If "method" is "post", the link specifies how a user can construct a document to submit to the link target for evaluation.
862862
</t>
863+
<t>
864+
Despite being named after HTTP's GET and POST, the presence,
865+
absence, or value of this keyword does not impose any constraints
866+
on either the method or protocol used to interact with the remote resource.
867+
In particular, the same Link Description Object may be used
868+
for multiple protocol methods. For protocol methods whose
869+
request format is described by <xref target="targetSchema">"targetSchema"</xref>,
870+
if "method" is "post" then <xref target="schema">"schema"</xref> is ignored.
871+
</t>
863872
<t>
864873
Values for this property SHOULD be lowercase, and SHOULD be compared case-insensitive. Use of other values not defined here SHOULD be ignored.
865874
</t>
@@ -915,7 +924,7 @@ GET /foo/
915924
</t>
916925

917926
<t>
918-
This is a separate concept from the "targetSchema" property, which is describing the target information resource (including for replacing the contents of the resource in a PUT request), unlike "schema" which describes the user-submitted request data to be evaluated by the resource.
927+
This is a separate concept from the <xref target="targetSchema">"targetSchema"</xref> property, which is describing the target information resource (including for replacing the contents of the resource in a PUT request), unlike "schema" which describes the user-submitted request data to be evaluated by the resource.
919928
</t>
920929
</section>
921930
</section>

0 commit comments

Comments
 (0)