Skip to content

Commit 7badac1

Browse files
committed
text/event-stream improvements
Add a few more details.
1 parent e85ea1c commit 7badac1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/oas.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,11 +1680,12 @@ For example, if partial content is read from a stream and then passed with the `
16801680

16811681
##### Special Considerations for `text/event-stream` Content
16821682

1683-
For `text/event-stream`, each item in the array MUST be treated as if it were a JSON object with property names taken from the left side of the `:`, property values from the right side, and consecutive lines with the same name treated as a single property, with the value combined in accordance with the [`text/event-stream` specification](https://html.spec.whatwg.org/multipage/iana.html#text/event-stream).
1683+
For `text/event-stream`, each item in the array MUST be treated as if it were a JSON object with property names taken from the left side of the `:` (or the enter non-empty line if no ":" is present), property values from the right side, and consecutive lines with the same name treated as a single property, with the value combined in accordance with the [`text/event-stream` specification](https://html.spec.whatwg.org/multipage/iana.html#text/event-stream).
16841684

16851685
Field names can be repeated within an item to allow splitting the value across multiple lines; such split values MUST be treated the same as if they were a single field, with newlines added as required by the [`text/event-stream` specification](https://html.spec.whatwg.org/multipage/iana.html#text/event-stream).
1686+
Similarly, when a field name appears without a value, the value MUST be treated as an empty string.
16861687

1687-
The `text/event-stream` specification requires that fields with Unknown names, as well as `id` fields where the value contains `U+0000 NULL` be ignored.
1688+
The `text/event-stream` specification requires that fields with Unknown names, as well as `id` fields where the value contains `U+0000 NULL` and `retry` fields with characters other than ASCII digits be ignored.
16881689
These fields SHOULD NOT be present in the data used with the Schema Object.
16891690

16901691
Field value types MUST be handled as specified by the `text/event-stream` specification (e.g. the `retry` field value is modeled as a JSON number that is expected to be of JSON Schema `type: integer`), and fields not given an explicit value type MUST be handled as strings.
@@ -1710,6 +1711,7 @@ items:
17101711
type: string
17111712
retry:
17121713
type: integer
1714+
minimum: 0
17131715
```
17141716

17151717
##### Media Type Examples

0 commit comments

Comments
 (0)