Skip to content

Commit 98647df

Browse files
committed
Review feedback from hudlow
This streamlines the text/event-stream discussion and makes a few other tweaks based on feedback from @hudlow.
1 parent 8c4869c commit 98647df

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/oas.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Each mapping is addressed where the relevant media type is discussed in this sec
9191

9292
#### Sequential Media Types
9393

94-
Within this specification, a _sequential media type_ is defined as any media type that consists of a repeating structure, separated by some delimiter, without any sort of header, footer, envelope, or other metadata in addition to the sequence.
94+
Within this specification, a _sequential media type_ is defined as any media type that consists of a repeating structure, without any sort of header, footer, envelope, or other metadata in addition to the sequence.
9595

9696
Some examples of sequential media types (including some that are not IANA-registered but are in common use) are:
9797

@@ -1660,8 +1660,8 @@ See also the [Media Type Registry](#media-type-registry).
16601660
##### Complete vs Streaming Content
16611661

16621662
The `schema` field MUST be applied to the complete content, as defined by the media type and the context ([Request Body Object](#request-body-object), [Response Object](#response-object), [Parameter Object](#parameter-object), or [Header Object](#header-object).
1663-
Unless some sort of streaming JSON Schema processor is available, this requires loading the entire content into memory.
1664-
This poses a challenge for streamed content, particularly streams where the client is intended to choose when to stop reading as there is no well-defined end to the stream.
1663+
Because this requires loading the content into memory in its entirety, it poses a challenge for streamed content.
1664+
Use cases where client is intended to choose when to stop reading are particularly challenging as there is no well-defined end to the stream.
16651665

16661666
###### Binary Streams
16671667

@@ -1680,13 +1680,7 @@ 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 `:` (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/server-sent-events.html#parsing-an-event-stream).
1684-
1685-
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/server-sent-events.html#parsing-an-event-stream).
1686-
Similarly, when a field name appears without a value, the value MUST be treated as an empty string.
1687-
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.
1689-
These fields SHOULD NOT be present in the data used with the Schema Object.
1683+
For `text/event-stream`, implementations MUST work with event data after it has been parsed according to the [`text/event-stream` specification](https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream), including all guidance on ignoring certain fields (including comments) and/or values, and on combining values split across multiple lines.
16901684

16911685
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.
16921686

0 commit comments

Comments
 (0)