From 03d8abc4e671448fae8101369fc883d0c5cd97d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Heidekr=C3=BCger?= Date: Mon, 16 Sep 2024 18:11:14 -0700 Subject: [PATCH 1/3] docs: mention non-JSON terminating byte sequences in Useful-OpenAPI-patterns.md --- .../Documentation.docc/Articles/Useful-OpenAPI-patterns.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/swift-openapi-generator/Documentation.docc/Articles/Useful-OpenAPI-patterns.md b/Sources/swift-openapi-generator/Documentation.docc/Articles/Useful-OpenAPI-patterns.md index 7c6140ab..b34e1de5 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Articles/Useful-OpenAPI-patterns.md +++ b/Sources/swift-openapi-generator/Documentation.docc/Articles/Useful-OpenAPI-patterns.md @@ -113,6 +113,7 @@ The returned binary body contains the raw events, and the stream can be split up - encode: `AsyncSequence.asEncodedJSONSequence(encoder:)` - Server-sent Events - decode (if data is JSON): `AsyncSequence>.asDecodedServerSentEventsWithJSONData(of:decoder:)` + - decode (if data is JSON with a non-JSON terminating byte sequence): `AsyncSequence>.asDecodedServerSentEventsWithJSONData(of:decoder:terminate:)` - encode (if data is JSON): `AsyncSequence.asEncodedServerSentEventsWithJSONData(encoder:)` - decode (for other data): `AsyncSequence>.asDecodedServerSentEvents()` - encode (for other data): `AsyncSequence.asEncodedServerSentEvents()` From 9d536e4429cad46d0a3862f0f34d5d6b5bde0e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Heidekr=C3=BCger?= Date: Thu, 3 Oct 2024 10:35:09 -0700 Subject: [PATCH 2/3] Update doc comment in Sources/swift-openapi-generator/Documentation.docc/Articles/Useful-OpenAPI-patterns.md Co-authored-by: Honza Dvorsky --- .../Documentation.docc/Articles/Useful-OpenAPI-patterns.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/swift-openapi-generator/Documentation.docc/Articles/Useful-OpenAPI-patterns.md b/Sources/swift-openapi-generator/Documentation.docc/Articles/Useful-OpenAPI-patterns.md index b34e1de5..b97aa92b 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Articles/Useful-OpenAPI-patterns.md +++ b/Sources/swift-openapi-generator/Documentation.docc/Articles/Useful-OpenAPI-patterns.md @@ -113,7 +113,7 @@ The returned binary body contains the raw events, and the stream can be split up - encode: `AsyncSequence.asEncodedJSONSequence(encoder:)` - Server-sent Events - decode (if data is JSON): `AsyncSequence>.asDecodedServerSentEventsWithJSONData(of:decoder:)` - - decode (if data is JSON with a non-JSON terminating byte sequence): `AsyncSequence>.asDecodedServerSentEventsWithJSONData(of:decoder:terminate:)` + - decode (if data is JSON with a non-JSON terminating byte sequence): `AsyncSequence>.asDecodedServerSentEventsWithJSONData(of:decoder:while:)` - encode (if data is JSON): `AsyncSequence.asEncodedServerSentEventsWithJSONData(encoder:)` - decode (for other data): `AsyncSequence>.asDecodedServerSentEvents()` - encode (for other data): `AsyncSequence.asEncodedServerSentEvents()` From a5cd6a070bbca878b4ff9b44ad63ae0f9744f76d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Heidekr=C3=BCger?= Date: Thu, 3 Oct 2024 10:35:23 -0700 Subject: [PATCH 3/3] Update doc comment in Sources/swift-openapi-generator/Documentation.docc/Articles/Useful-OpenAPI-patterns.md Co-authored-by: Honza Dvorsky --- .../Documentation.docc/Articles/Useful-OpenAPI-patterns.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/swift-openapi-generator/Documentation.docc/Articles/Useful-OpenAPI-patterns.md b/Sources/swift-openapi-generator/Documentation.docc/Articles/Useful-OpenAPI-patterns.md index b97aa92b..258848f3 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Articles/Useful-OpenAPI-patterns.md +++ b/Sources/swift-openapi-generator/Documentation.docc/Articles/Useful-OpenAPI-patterns.md @@ -115,7 +115,7 @@ The returned binary body contains the raw events, and the stream can be split up - decode (if data is JSON): `AsyncSequence>.asDecodedServerSentEventsWithJSONData(of:decoder:)` - decode (if data is JSON with a non-JSON terminating byte sequence): `AsyncSequence>.asDecodedServerSentEventsWithJSONData(of:decoder:while:)` - encode (if data is JSON): `AsyncSequence.asEncodedServerSentEventsWithJSONData(encoder:)` - - decode (for other data): `AsyncSequence>.asDecodedServerSentEvents()` + - decode (for other data): `AsyncSequence>.asDecodedServerSentEvents(while:)` - encode (for other data): `AsyncSequence.asEncodedServerSentEvents()` See the `event-streams-*` client and server examples in to learn how to produce and consume these sequences.