Skip to content

Commit b423622

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. Further clarify atht "schema" SHOULD be ignored if it is not relevant. 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. To clarify non-HTTP usage in generic terms, add some wording about request formats being defined in terms of the target representation or not. This should provide more guidance for when "method": "post" and "schema" are relevant, independent of URI scheme.
1 parent d3c75a8 commit b423622

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

jsonschema-hyperschema.xml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ GET /foo/
702702
</t>
703703
</section>
704704

705-
<section title="targetSchema">
705+
<section title="targetSchema" anchor="targetSchema">
706706
<t>
707707
This property provides a schema that is expected to describe
708708
the link target's representation. Depending on the protocol,
@@ -873,17 +873,35 @@ GET /foo/
873873
This property specifies that the client can construct a templated query or non-idempotent request to a resource.
874874
</t>
875875
<t>
876-
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.
876+
If "method" is "get", the link identifies how a client can compute the URI of an arbitrary resource.
877+
For example, how to compute a link to a page of search results relating to the instance, for a user-selected query term.
877878
</t>
878879
<t>
879-
If "method" is "post", the link specifies how a user can construct a document to submit to the link target for evaluation.
880+
If "method" is "post", the link specifies how a client can construct
881+
a document to submit to the link target for evaluation.
882+
This option is most useful for requests requiring a payload that is not described
883+
in terms of the target representation, since the target
884+
representation is described by <xref target="targetSchema">"targetSchema"</xref>.
885+
</t>
886+
<t>
887+
Despite being named after HTTP's GET and POST, the presence,
888+
absence, or value of this keyword does not impose any constraints
889+
on either the protocol or method used to interact with the remote resource.
890+
In particular, the same Link Description Object may be used
891+
for multiple protocol methods.
892+
</t>
893+
<t>
894+
For protocol methods whose request format is derived from
895+
the target representation, if "method" is "post" then
896+
<xref target="schema">"schema"</xref> and
897+
<xref target="encType">"encTYpe"</xref> SHOULD be ignored.
880898
</t>
881899
<t>
882900
Values for this property SHOULD be lowercase, and SHOULD be compared case-insensitive. Use of other values not defined here SHOULD be ignored.
883901
</t>
884902
</section>
885903

886-
<section title="encType">
904+
<section title="encType" anchor="encType">
887905
<t>
888906
If present, this property indicates the media type format the client should use to encode a query parameter or send to the server.
889907
If the method is "get", this will indicate how to encode the query-string that is appended to the "href" link target.
@@ -933,7 +951,9 @@ GET /foo/
933951
</t>
934952

935953
<t>
936-
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.
954+
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.
955+
"schema" is intended for use with requests that have payloads that are not
956+
defined in terms of the target representation.
937957
</t>
938958
</section>
939959
</section>

0 commit comments

Comments
 (0)