Skip to content

Commit

Permalink
Refactors EndpointToSttpClientExtensions
Browse files Browse the repository at this point in the history
* The only thing that can be found there is related to WebSockets, hence the renaming and extending the trait by WebSocketEndpointToSttpClient, not the base one
  • Loading branch information
Michal Stopyra committed Feb 20, 2025
1 parent 0a2b523 commit 248c55e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import sttp.client4.ws.async
import sttp.model._
import sttp.tapir._
import sttp.tapir.client.ClientOutputParams
import sttp.tapir.client.sttp4.{EndpointToSttpClient, EndpointToSttpClientExtensions, WebSocketToPipe}
import sttp.tapir.client.sttp4.{EndpointToSttpClient, WebSocketEndpointToSttpClientExtensions, WebSocketToPipe}
import sttp.tapir.internal._
import sttp.ws.WebSocket

private[sttp] class WebSocketEndpointToSttpClient[R](wsToPipe: WebSocketToPipe[R])
extends EndpointToSttpClient
with EndpointToSttpClientExtensions {
with WebSocketEndpointToSttpClientExtensions {
def toSttpRequest[F[_], A, E, O, I](
e: Endpoint[A, I, E, O, R],
baseUri: Option[Uri]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package sttp.tapir.client.sttp4

import sttp.model.StatusCode

private[sttp4] trait EndpointToSttpClientExtensions { this: EndpointToSttpClient[_] =>
private[sttp4] trait WebSocketEndpointToSttpClientExtensions {

/** This needs to be platform-specific due to #2663, as on JS we don't get access to the 101 status code. */
val webSocketSuccessStatusCode: StatusCode = StatusCode.Ok
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package sttp.tapir.client.sttp4

import sttp.model.StatusCode

private[sttp] trait EndpointToSttpClientExtensions { this: EndpointToSttpClient[_] =>
private[sttp4] trait WebSocketEndpointToSttpClientExtensions {

/** This needs to be platform-specific due to #2663, as on JS we don't get access to the 101 status code. */
val webSocketSuccessStatusCode: StatusCode = StatusCode.SwitchingProtocols
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package sttp.tapir.client.sttp
package sttp.tapir.client.sttp4

import sttp.model.StatusCode

private[sttp] trait EndpointToSttpClientExtensions { this: EndpointToSttpClient[_] =>
private[sttp4] trait WebSocketEndpointToSttpClientExtensions {

/** This needs to be platform-specific due to #2663, as on JS we don't get access to the 101 status code. */
val webSocketSuccessStatusCode: StatusCode = StatusCode.SwitchingProtocols
Expand Down

0 comments on commit 248c55e

Please sign in to comment.