Skip to content

Commit c8e722d

Browse files
committed
Remove "method", URI input with "hrefVars"
In the most recent draft, "method" simply controlled whether link input was placed in the URI (for a value of "get") or in the request body (for a valued of "post"). While correlating with HTML, this was both confusing due to "get" and "post" not necessarily indicating the HTTP methods of the same name, and limiting in that users/clients could not submit data through both the URI and the request body at the same time. This introduces "hrefVars" which provides a schema for user input matching the "href" URI Template variables. It removes "method" and makes "schema" and "encType" unambiguously apply to the request body in all cases. Clients should choose when to use the request body submission based on the rules of the protocol given by the URI scheme and the semantics indicated by the link relation. Additionally, the complex and apparently rarely if ever used preprocessing rules have been removed, and both the resulting and pre-existing limitations have been documented. They will be the subject of work for future drafts. The meta-schemas have been updated accordingly, and the LDO schema has been brought over from the web site repo and updated. Improper use of "$ref" has been fixed with "allOf".
1 parent e784d5d commit c8e722d

File tree

3 files changed

+201
-167
lines changed

3 files changed

+201
-167
lines changed

hyper-schema.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
"properties": {
1919
"href": {
2020
"description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",
21-
"type": "string"
21+
"type": "string",
22+
"format": "uritemplate"
23+
},
24+
"hrefVars": {
25+
"description": "a schema for validating user input to the URI template, where the input is in the form of a JSON object with property names matching variable names in \"href\"",
26+
"allOf": [ {"$ref": "#"} ]
2227
},
2328
"rel": {
2429
"description": "relation to the target resource of the link",
@@ -96,7 +101,8 @@
96101

97102
"base": {
98103
"description": "URI Template resolved as for the 'href' keyword in the Link Description Object. The resulting URI Reference is resolved against the current URI base and sets the new URI base for URI references within the instance.",
99-
"type": "string"
104+
"type": "string",
105+
"format": "uritemplate"
100106
},
101107
"links": {
102108
"type": "array",

0 commit comments

Comments
 (0)