From 074b654e106b5529894770197e8ad38237ab364e Mon Sep 17 00:00:00 2001 From: "Henry H. Andrews" Date: Sat, 20 Apr 2024 14:30:44 -0700 Subject: [PATCH 1/3] Clarify how to model streaming binary data --- versions/3.0.4.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/versions/3.0.4.md b/versions/3.0.4.md index 9bab2e150e..318fddddfe 100644 --- a/versions/3.0.4.md +++ b/versions/3.0.4.md @@ -171,6 +171,8 @@ Two formats, `binary` and `byte`, describe different ways to work with binary da * `binary` is used where unencoded binary data is allowed, such as when sending a binary payload as an HTTP message body, or as part of a `multipart/*` payload that allows binary parts * `byte` is used where binary data is embedded in a text-only format such as `application/json` or `application/x-www-form-urlencoded` +The `maxLength` keyword can be used to set an upper bound on the length of a binary payload; otherwise, a binary payload SHOULD be interpreted as a stream of indeterminate length. + Note that the encoding indicated by `byte`, which inflates the size of data in order to represent it as 7-bit ASCII text, is unrelated to HTTP's `Content-Encoding` header, which indicates whether and how a message body has been compressed. ### Rich Text Formatting From aace8d62543a1d5f0baed31d44ad7a9bad919a46 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Thu, 25 Apr 2024 14:01:14 -0700 Subject: [PATCH 2/3] Explain how maxLength applies to raw binary Co-authored-by: Ralf Handl --- versions/3.0.4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/3.0.4.md b/versions/3.0.4.md index 318fddddfe..86eb5a48b7 100644 --- a/versions/3.0.4.md +++ b/versions/3.0.4.md @@ -171,7 +171,7 @@ Two formats, `binary` and `byte`, describe different ways to work with binary da * `binary` is used where unencoded binary data is allowed, such as when sending a binary payload as an HTTP message body, or as part of a `multipart/*` payload that allows binary parts * `byte` is used where binary data is embedded in a text-only format such as `application/json` or `application/x-www-form-urlencoded` -The `maxLength` keyword can be used to set an upper bound on the length of a binary payload; otherwise, a binary payload SHOULD be interpreted as a stream of indeterminate length. +The `maxLength` keyword can be used to set an upper bound on the length (in octets) of a binary payload; otherwise, a binary payload SHOULD be interpreted as a stream of indeterminate length. Note that the encoding indicated by `byte`, which inflates the size of data in order to represent it as 7-bit ASCII text, is unrelated to HTTP's `Content-Encoding` header, which indicates whether and how a message body has been compressed. From 0c4aef71edd80c3ae6a35c36a28fda14bed8150e Mon Sep 17 00:00:00 2001 From: "Henry H. Andrews" Date: Fri, 26 Apr 2024 09:22:15 -0700 Subject: [PATCH 3/3] Include streaming string data, other wording improvements. --- versions/3.0.4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/3.0.4.md b/versions/3.0.4.md index 86eb5a48b7..cc53550d85 100644 --- a/versions/3.0.4.md +++ b/versions/3.0.4.md @@ -171,7 +171,7 @@ Two formats, `binary` and `byte`, describe different ways to work with binary da * `binary` is used where unencoded binary data is allowed, such as when sending a binary payload as an HTTP message body, or as part of a `multipart/*` payload that allows binary parts * `byte` is used where binary data is embedded in a text-only format such as `application/json` or `application/x-www-form-urlencoded` -The `maxLength` keyword can be used to set an upper bound on the length (in octets) of a binary payload; otherwise, a binary payload SHOULD be interpreted as a stream of indeterminate length. +The `maxLength` keyword MAY be used to set an expected upper bound on the length of a streaming payload. The keyword can be applied to either string data, including encoded binary data, or to unencoded binary data. For unencoded binary, the length is the number of octets. Note that the encoding indicated by `byte`, which inflates the size of data in order to represent it as 7-bit ASCII text, is unrelated to HTTP's `Content-Encoding` header, which indicates whether and how a message body has been compressed.