Skip to content

Commit 68d8d9c

Browse files
committed
Deprecated: mark asDecodedServerSentEvents as deprecated
1 parent 6c44fb1 commit 68d8d9c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Sources/OpenAPIRuntime/Deprecated/Deprecated.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,14 @@ extension Configuration {
5959
)
6060
}
6161
}
62+
63+
extension AsyncSequence where Element == ArraySlice<UInt8>, Self: Sendable {
64+
/// Returns another sequence that decodes each event's data as the provided type using the provided decoder.
65+
///
66+
/// Use this method if the event's `data` field is not JSON, or if you don't want to parse it using `asDecodedServerSentEventsWithJSONData`.
67+
/// - Returns: A sequence that provides the events.
68+
@available(*, deprecated, renamed: "asDecodedServerSentEvents(while:)")
69+
@_disfavoredOverload public func asDecodedServerSentEvents() -> ServerSentEventsDeserializationSequence<
70+
ServerSentEventsLineDeserializationSequence<Self>
71+
> { asDecodedServerSentEvents(while: { _ in true }) }
72+
}

0 commit comments

Comments
 (0)