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
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1902,29 +1902,52 @@ multipart/mixed:
1902
1902
1903
1903
###### Example: Ordered Multipart With Required Header
1904
1904
1905
-
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.
1905
+
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.
1906
+
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.
1906
1907
1907
-
See [Appendix D](appendix-d-serializing-headers-and-cookies) for an explanation of why `content: {text/plain: {...}}` is used to describe the header value.
1908
+
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.
1908
1909
1909
1910
```yaml
1910
-
multipart/related:
1911
-
schema:
1912
-
items:
1913
-
type: string
1914
-
itemEncoding:
1915
-
contentType: text/html
1916
-
headers:
1917
-
Content-Location:
1918
-
required: true
1919
-
content:
1920
-
text/plain:
1921
-
schema:
1922
-
type: string
1923
-
format: uri
1911
+
components:
1912
+
headers:
1913
+
RFC2557ContentId:
1914
+
description: Use Content-Location instead of Content-ID
1915
+
schema: false
1916
+
RFC2557ContentLocation:
1917
+
required: true
1918
+
content:
1919
+
text/plain:
1920
+
schema:
1921
+
$comment: Use a full URI (not a relative reference)
1922
+
type: string
1923
+
format: uri
1924
+
requestBodies:
1925
+
RFC2557:
1926
+
content:
1927
+
multipart/related; type=text/html:
1928
+
schema:
1929
+
prefixItems:
1930
+
- type: string
1931
+
items:
1932
+
anyOf:
1933
+
- type: string
1934
+
- $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.
1927
-
1928
1951
###### Example: Streaming Multipart
1929
1952
1930
1953
This example assumes a device that takes large sets of pictures and streams them to the caller.
0 commit comments