You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: draft-ietf-httpapi-link-hint.md
+30-48Lines changed: 30 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,10 +83,9 @@ In JSON-based formats, this can be achieved by simply serialising link hints as
83
83
"href": "/orders/523",
84
84
"hints": {
85
85
"allow": ["GET", "POST"],
86
-
"accept-post": {
87
-
"application/example+json":
88
-
{}
89
-
}
86
+
"accept-post": [
87
+
"application/example+json"
88
+
]
90
89
}
91
90
}
92
91
}
@@ -116,52 +115,19 @@ Content MUST be an array of strings, containing HTTP methods ({{Section 9 of HTT
116
115
117
116
* Hint Name: formats
118
117
* Description: Hints the representation type(s) that the target resource can produce and consume, using the GET and PUT (if allowed) methods respectively.
119
-
* Content Model: object
120
-
* Specification: \[this document]
121
-
122
-
Content MUST be an object, whose keys are media types ({{Section 8.3.1 of HTTP}}), and values are objects.
123
-
124
-
The object MAY have a "links" member, whose value is an object representing links (in the sense of {{WEB-LINKING}}) whose context is any document that uses that format. Generally, this will be schema or profile ({{?RFC6906}}) information. The "links" member has the same format as the "links" hint.
125
-
126
-
Furthermore, the object MAY have a "deprecated" member, whose value is either true or false, indicating whether support for the format might be removed in the near future.
127
-
128
-
All other members of the object are under control of the corresponding media type's definition.
129
-
130
-
131
-
## links
132
-
133
-
* Hint Name: links
134
-
* Description: Hints at links whose context is the target resource.
135
-
* Content Model: object
118
+
* Content Model: array (of strings)
136
119
* Specification: \[this document]
137
120
138
-
The "links" hint contains links (in the sense of {{WEB-LINKING}}) whose context is the hinted target resource, which are stable for the lifetime of the hint.
139
-
140
-
Content MUST be an object, whose member names are link relations ({{WEB-LINKING}}) and values are objects that MUST have an "href" member whose value is a URI-reference ({{URI}}, using the original link as the base for resolution) for the link hint's target resource, and MAY itself contain link hints, serialised as the value for a "hints" member.
141
-
142
-
For example:
143
-
144
-
~~~ json
145
-
"links": {
146
-
"edit-form": {
147
-
"href": "./edit",
148
-
"hints": {
149
-
"formats": {
150
-
"application/json": {}
151
-
}
152
-
}
153
-
}
154
-
}
155
-
~~~
121
+
Content MUST be an array of strings, containing media types ({{Section 8.3.1 of HTTP}}).
156
122
157
123
## accept-post
158
124
159
125
* Hint Name: accept-post
160
126
* Description: Hints the POST request format(s) that the target resource can consume.
161
-
* Content Model: object
127
+
* Content Model: array (of strings)
162
128
* Specification: \[this document]
163
129
164
-
Content MUST be an object, with the same constraints as for "formats".
130
+
Content MUST be an array of strings, with the same constraints as for "formats".
165
131
166
132
When this hint is present, "POST" SHOULD be listed in the "allow" hint.
167
133
@@ -209,20 +175,36 @@ See also the 428 Precondition Required status code ({{!RFC6585}}).
209
175
210
176
* Hint Name: auth-schemes
211
177
* Description: Hints that the target resource requires authentication using the HTTP Authentication framework {{Section 11 of HTTP}}.
212
-
* Content Model: array (of objects)
178
+
* Content Model: array (of strings)
213
179
* Specification: \[this document]
214
180
215
-
Content MUST be an array of objects, each with a "scheme" member containing a string that corresponds to a HTTP authentication scheme ({{Section 11.1 of HTTP}}), and optionally a "realms" member containing an array of zero to many strings that identify protection spaces that the resource is a member of.
181
+
Content MUST be an array of strings, each corresponding to a HTTP authentication scheme ({{Section 11.1 of HTTP}}), and optionally a "realms" member containing an array of zero to many strings that identify protection spaces that the resource is a member of.
216
182
217
183
For example:
218
184
219
185
~~~ json
220
186
{
221
-
"auth-req": [
222
-
{
223
-
"scheme": "Basic",
224
-
"realms": ["private"]
225
-
}
187
+
"auth-schemes": [
188
+
"Basic", "Digest"
189
+
]
190
+
}
191
+
~~~
192
+
193
+
## auth-realms
194
+
195
+
* Hint Name: auth-realms
196
+
* Description: Hints the authentication realm(s) available for those schemes that support them in the HTTP Authentication framework {{Section 11 of HTTP}}.
197
+
* Content Model: array (of strings)
198
+
* Specification: \[this document]
199
+
200
+
Content MUST be an array of strings, each indicating a protection space that the resource is a member of.
0 commit comments