Skip to content

Commit

Permalink
Docs: Reference Handling of Custom Terminating Byte Sequences (#625)
Browse files Browse the repository at this point in the history
### Motivation

See: apple/swift-openapi-runtime#115

### Modifications

This PR references the changes introduced by TODO in the documentation.

### Result

Users planning to generate code for OpenAPI specs with custom
terminating byte sequences will hopefully find it easier to make the
necessary changes in their code.

Please let me know if there are other places where these changes could
be mentioned.

### Test Plan
.

---------

Co-authored-by: Honza Dvorsky <[email protected]>
  • Loading branch information
paulhdk and czechboy0 authored Oct 3, 2024
1 parent 89d49d2 commit de51f3d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ The returned binary body contains the raw events, and the stream can be split up
- encode: `AsyncSequence<some Encodable>.asEncodedJSONSequence(encoder:)`
- Server-sent Events
- decode (if data is JSON): `AsyncSequence<ArraySlice<UInt8>>.asDecodedServerSentEventsWithJSONData(of:decoder:)`
- decode (if data is JSON with a non-JSON terminating byte sequence): `AsyncSequence<ArraySlice<UInt8>>.asDecodedServerSentEventsWithJSONData(of:decoder:while:)`
- encode (if data is JSON): `AsyncSequence<some Encodable>.asEncodedServerSentEventsWithJSONData(encoder:)`
- decode (for other data): `AsyncSequence<ArraySlice<UInt8>>.asDecodedServerSentEvents()`
- decode (for other data): `AsyncSequence<ArraySlice<UInt8>>.asDecodedServerSentEvents(while:)`
- encode (for other data): `AsyncSequence<some Encodable>.asEncodedServerSentEvents()`

See the `event-streams-*` client and server examples in <doc:Checking-out-an-example-project> to learn how to produce and consume these sequences.

0 comments on commit de51f3d

Please sign in to comment.