Skip to content

"method" does not constrain HTTP methods #280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions jsonschema-hyperschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ GET /foo/
</t>
</section>

<section title="targetSchema">
<section title="targetSchema" anchor="targetSchema">
<t>
This property provides a schema that is expected to describe
the link target's representation. Depending on the protocol,
Expand Down Expand Up @@ -873,17 +873,35 @@ GET /foo/
This property specifies that the client can construct a templated query or non-idempotent request to a resource.
</t>
<t>
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.
If "method" is "get", the link identifies how a client 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.
</t>
<t>
If "method" is "post", the link specifies how a user can construct a document to submit to the link target for evaluation.
If "method" is "post", the link specifies how a client can construct
a document to submit to the link target for evaluation.
This option is most useful for requests requiring a payload that is not described
in terms of the target representation, since the target
representation is described by <xref target="targetSchema">"targetSchema"</xref>.
</t>
<t>
Despite being named after HTTP's GET and POST, the presence,
absence, or value of this keyword does not impose any constraints
on either the protocol or method used to interact with the remote resource.
In particular, the same Link Description Object may be used
for multiple protocol methods.
</t>
<t>
For protocol methods whose request format is derived from
the target representation, if "method" is "post" then
<xref target="schema">"schema"</xref> and
<xref target="encType">"encTYpe"</xref> SHOULD be ignored.
</t>
<t>
Values for this property SHOULD be lowercase, and SHOULD be compared case-insensitive. Use of other values not defined here SHOULD be ignored.
</t>
</section>

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

<t>
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.
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.
"schema" is intended for use with requests that have payloads that are not
defined in terms of the target representation.
</t>
</section>
</section>
Expand Down