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: src/oas.md
+41-18Lines changed: 41 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -1927,29 +1927,52 @@ multipart/mixed:
1927
1927
1928
1928
###### Example: Ordered Multipart With Required Header
1929
1929
1930
-
As described in [[?RFC2557]], a set of HTML pages can be sent in a `multipart/related` payload, preserving links among themselves by defining a `Content-Location` header for each page.
1930
+
As described in [[?RFC2557]], a set of resources making up a web pages can be sent in a `multipart/related` payload, preserving links among themselves by defining a `Content-Location` header for each page.
1931
+
The first part is used as the root resource (unless using `Content-ID`, which RFC2557 advises against), so we use `prefixItems` and `prefixEncoding` to define that it must be an HTML resource, and then allow any of several different types of resources in any order to follow.
1931
1932
1932
-
See [Appendix D](appendix-d-serializing-headers-and-cookies) for an explanation of why `content: {text/plain: {...}}` is used to describe the header value.
1933
+
The `Content-Location` header is defined using `content: {text/plain: {...}}` to avoid percent-encoding its URI value; see [Appendix D](appendix-d-serializing-headers-and-cookies) for further details.
1933
1934
1934
1935
```yaml
1935
-
multipart/related:
1936
-
schema:
1937
-
items:
1938
-
type: string
1939
-
itemEncoding:
1940
-
contentType: text/html
1941
-
headers:
1942
-
Content-Location:
1943
-
required: true
1944
-
content:
1945
-
text/plain:
1946
-
schema:
1947
-
type: string
1948
-
format: uri
1936
+
components:
1937
+
headers:
1938
+
RFC2557ContentId:
1939
+
description: Use Content-Location instead of Content-ID
1940
+
schema: false
1941
+
RFC2557ContentLocation:
1942
+
required: true
1943
+
content:
1944
+
text/plain:
1945
+
schema:
1946
+
$comment: Use a full URI (not a relative reference)
1947
+
type: string
1948
+
format: uri
1949
+
requestBodies:
1950
+
RFC2557:
1951
+
content:
1952
+
multipart/related; type=text/html:
1953
+
schema:
1954
+
prefixItems:
1955
+
- type: string
1956
+
items:
1957
+
anyOf:
1958
+
- type: string
1959
+
- $comment: To allow binary, this must always pass
While the above example could have used `itemSchema` instead, if the payload is expected to be processed all at once, using `schema` ensures that tools will wait until the complete response is available before processing.
1952
-
1953
1976
###### Example: Streaming Multipart
1954
1977
1955
1978
This example assumes a device that takes large sets of pictures and streams them to the caller.
0 commit comments