Skip to content

Commit 2ccf35b

Browse files
committed
Code compiles and example booksSttpClient4Example works
1 parent 5680878 commit 2ccf35b

File tree

47 files changed

+335
-143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+335
-143
lines changed

build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2158,6 +2158,7 @@ lazy val examples: ProjectMatrix = (projectMatrix in file("examples"))
21582158
picklerJson,
21592159
prometheusMetrics,
21602160
sttpClient,
2161+
sttpClient4,
21612162
sttpMockServer,
21622163
sttpStubServer,
21632164
swaggerUiBundle,

client/sttp-client4/src/main/scala/sttp/tapir/client/sttp/EndpointToSttpClient.scala renamed to client/sttp-client4/src/main/scala/sttp/tapir/client/sttp4/EndpointToSttpClient.scala

Lines changed: 53 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,61 @@
1-
package sttp.tapir.client.sttp
1+
package sttp.tapir.client.sttp4
22

33
import sttp.capabilities.Streams
44
import sttp.client4._
5+
import sttp.client4.ws.async
56
import sttp.model._
6-
import sttp.shared.Identity
7-
import sttp.tapir.Codec.PlainCodec
87
import sttp.tapir._
8+
import sttp.tapir.Codec.PlainCodec
99
import sttp.tapir.client.ClientOutputParams
1010
import sttp.tapir.internal._
1111
import sttp.ws.WebSocket
1212

13-
import java.io.ByteArrayInputStream
13+
import java.io.{ByteArrayInputStream, InputStream}
1414
import java.nio.ByteBuffer
1515
import scala.annotation.tailrec
1616

1717
private[sttp] class EndpointToSttpClient[R](clientOptions: SttpClientOptions, wsToPipe: WebSocketToPipe[R])
1818
extends EndpointToSttpClientExtensions {
19-
def toSttpRequest[A, E, O, I](e: Endpoint[A, I, E, O, R], baseUri: Option[Uri]): A => I => Request[DecodeResult[Either[E, O]], R] = {
20-
aParams => iParams =>
21-
val (uri1, req1) =
22-
setInputParams(
23-
e.securityInput,
24-
ParamsAsAny(aParams),
25-
baseUri.getOrElse(Uri(None, None, Uri.EmptyPath, Nil, None)),
26-
basicRequest.asInstanceOf[PartialAnyRequest]
27-
)
28-
29-
val (uri2, req2) =
30-
setInputParams(
31-
e.input,
32-
ParamsAsAny(iParams),
33-
uri1,
34-
req1
35-
)
36-
37-
val req3: RequestT[Identity, _, _] =
38-
req2.copy(
39-
method = sttp.model.Method(e.method.getOrElse(Method.GET).method): Identity[Method],
40-
uri = uri2: Identity[Uri]
41-
)
42-
43-
val isWebSocket = bodyIsWebSocket(e.output)
44-
45-
def isSuccess(meta: ResponseMetadata) = if (isWebSocket) meta.code == webSocketSuccessStatusCode else meta.isSuccess
46-
47-
val responseAs = fromMetadata(
48-
responseAsFromOutputs(e.errorOutput, isWebSocket = false),
49-
ConditionalResponseAs(isSuccess, responseAsFromOutputs(e.output, isWebSocket))
50-
).mapWithMetadata { (body, meta) =>
51-
val output = if (isSuccess(meta)) e.output else e.errorOutput
52-
val params = clientOutputParams(output, body, meta)
53-
params.map(_.asAny).map(p => if (isSuccess(meta)) Right(p) else Left(p))
54-
}.map {
55-
case DecodeResult.Error(o, e) =>
56-
DecodeResult.Error(o, new IllegalArgumentException(s"Cannot decode from: $o, request: ${req3.method} ${req3.uri}", e))
57-
case other => other
58-
}
19+
def toSttpRequest[A, E, O, I](e: Endpoint[A, I, E, O, R], baseUri: Option[Uri]): A => I => Request[DecodeResult[Either[E, O]]] = { aParams => iParams =>
20+
val (uri1, req1) =
21+
setInputParams(
22+
e.securityInput,
23+
ParamsAsAny(aParams),
24+
baseUri.getOrElse(Uri(None, None, Uri.EmptyPath, Nil, None)),
25+
basicRequest.asInstanceOf[PartialAnyRequest]
26+
)
27+
28+
val (uri2, req2) =
29+
setInputParams(
30+
e.input,
31+
ParamsAsAny(iParams),
32+
uri1,
33+
req1
34+
)
35+
36+
val req3 = req2.method(sttp.model.Method(e.method.getOrElse(Method.GET).method), uri2)
37+
38+
val isWebSocket = bodyIsWebSocket(e.output)
39+
40+
def isSuccess(meta: ResponseMetadata) = if (isWebSocket) meta.code == webSocketSuccessStatusCode else meta.isSuccess
41+
42+
val responseAs = fromMetadata(
43+
responseAsFromOutputs(e.errorOutput, isWebSocket = false),
44+
ConditionalResponseAs(isSuccess, responseAsFromOutputs(e.output, isWebSocket))
45+
).mapWithMetadata { (body, meta) =>
46+
val output = if (isSuccess(meta)) e.output else e.errorOutput
47+
val params = clientOutputParams(output, body, meta)
48+
params.map(_.asAny).map(p => if (isSuccess(meta)) Right(p) else Left(p))
49+
}.map {
50+
case DecodeResult.Error(o, e) =>
51+
DecodeResult.Error(o, new IllegalArgumentException(s"Cannot decode from: $o, request: ${req3.method} ${req3.uri}", e))
52+
case other => other
53+
}
5954

60-
req3.response(responseAs).asInstanceOf[Request[DecodeResult[Either[E, O]], R]]
55+
req3.response(responseAs).asInstanceOf[Request[DecodeResult[Either[E, O]]]]
6156
}
6257

63-
private type PartialAnyRequest = PartialRequest[_, _]
58+
private type PartialAnyRequest = PartialRequest[_]
6459

6560
@tailrec
6661
private def setInputParams[I](
@@ -100,11 +95,11 @@ private[sttp] class EndpointToSttpClient[R](clientOptions: SttpClientOptions, ws
10095
EndpointIO.OneOfBodyVariant(_, Right(EndpointIO.StreamBodyWrapper(StreamBodyIO(streams, _, _, _, _)))) :: _,
10196
_
10297
) =>
103-
val req2 = req.streamBody(streams)(value.asInstanceOf[streams.BinaryStream])
98+
val req2 = req.body(value.asInstanceOf[InputStream])
10499
(uri, req2)
105100
case EndpointIO.OneOfBody(Nil, _) => throw new RuntimeException("One of body without variants")
106101
case EndpointIO.StreamBodyWrapper(StreamBodyIO(streams, _, _, _, _)) =>
107-
val req2 = req.streamBody(streams)(value.asInstanceOf[streams.BinaryStream])
102+
val req2 = req.body(value.asInstanceOf[InputStream])
108103
(uri, req2)
109104
case EndpointIO.Header(name, codec, _) =>
110105
val req2 = codec
@@ -114,8 +109,11 @@ private[sttp] class EndpointToSttpClient[R](clientOptions: SttpClientOptions, ws
114109
case EndpointIO.Headers(codec, _) =>
115110
val headers = codec.encode(value)
116111
val req2 = headers.foldLeft(req) { case (r, h) =>
117-
val replaceExisting = HeaderNames.ContentType.equalsIgnoreCase(h.name) || HeaderNames.ContentLength.equalsIgnoreCase(h.name)
118-
r.header(h, replaceExisting)
112+
val onDuplicate =
113+
if (HeaderNames.ContentType.equalsIgnoreCase(h.name) || HeaderNames.ContentLength.equalsIgnoreCase(h.name))
114+
DuplicateHeaderBehavior.Replace
115+
else DuplicateHeaderBehavior.Add
116+
r.header(h, onDuplicate)
119117
}
120118
(uri, req2)
121119
case EndpointIO.FixedHeader(h, _, _) =>
@@ -174,7 +172,7 @@ private[sttp] class EndpointToSttpClient[R](clientOptions: SttpClientOptions, ws
174172
case RawBodyType.FileBody => req.body(encoded.file)
175173
case RawBodyType.InputStreamRangeBody => req.body(encoded.inputStream())
176174
case m: RawBodyType.MultipartBody =>
177-
val parts: Seq[Part[RequestBody[Any]]] = (encoded: Seq[RawPart]).flatMap { p =>
175+
val parts: Seq[Part[BasicBodyPart]] = (encoded: Seq[RawPart]).flatMap { p =>
178176
m.partType(p.name).map { partType =>
179177
// copying the name & body
180178
val sttpPart1 = partToSttpPart(p.asInstanceOf[Part[Any]], partType.asInstanceOf[RawBodyType[Any]])
@@ -193,7 +191,7 @@ private[sttp] class EndpointToSttpClient[R](clientOptions: SttpClientOptions, ws
193191
if (wasContentTypeAlreadySet) req2 else req2.contentType(codec.format.mediaType)
194192
}
195193

196-
private def partToSttpPart[T](p: Part[T], bodyType: RawBodyType[T]): Part[RequestBody[Any]] =
194+
private def partToSttpPart[T](p: Part[T], bodyType: RawBodyType[T]): Part[BasicBodyPart] =
197195
bodyType match {
198196
case RawBodyType.StringBody(charset) => multipart(p.name, p.body, charset.toString)
199197
case RawBodyType.ByteArrayBody => multipart(p.name, p.body)
@@ -204,10 +202,10 @@ private[sttp] class EndpointToSttpClient[R](clientOptions: SttpClientOptions, ws
204202
case RawBodyType.MultipartBody(_, _) => throw new IllegalArgumentException("Nested multipart bodies aren't supported")
205203
}
206204

207-
private def responseAsFromOutputs(out: EndpointOutput[_], isWebSocket: Boolean): ResponseAs[Any, Any] = {
205+
private def responseAsFromOutputs(out: EndpointOutput[_], isWebSocket: Boolean): ResponseAs[Any] = {
208206
((bodyIsStream(out), isWebSocket) match {
209207
case (Some(streams), _) => asStreamAlwaysUnsafe(streams)
210-
case (_, true) => asWebSocketAlwaysUnsafe
208+
case (_, true) => async.asWebSocketAlwaysUnsafe
211209
case (None, false) =>
212210
out.bodyType
213211
.map {
@@ -220,7 +218,7 @@ private[sttp] class EndpointToSttpClient[R](clientOptions: SttpClientOptions, ws
220218
case RawBodyType.MultipartBody(_, _) => throw new IllegalArgumentException("Multipart bodies aren't supported in responses")
221219
}
222220
.getOrElse(ignore)
223-
}).asInstanceOf[ResponseAs[Any, Any]]
221+
}).asInstanceOf[ResponseAs[Any]]
224222
}
225223

226224
private def bodyIsStream[I](out: EndpointOutput[I]): Option[Streams[_]] = {

client/sttp-client4/src/main/scala/sttp/tapir/client/sttp/SttpClientInterpreter.scala renamed to client/sttp-client4/src/main/scala/sttp/tapir/client/sttp4/SttpClientInterpreter.scala

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package sttp.tapir.client.sttp
1+
package sttp.tapir.client.sttp4
22

3-
import sttp.client4.{Request, SttpBackend}
3+
import sttp.client4.{Backend, Request}
44
import sttp.model.Uri
55
import sttp.tapir.{DecodeResult, Endpoint, PublicEndpoint}
66

@@ -17,11 +17,12 @@ trait SttpClientInterpreter extends SttpClientInterpreterExtensions {
1717
* parameters: path, query, headers and body. The request is sent using the given backend, and the result of decoding the response (error
1818
* or success value) is returned.
1919
*/
20-
def toClient[F[_], I, E, O, R](e: PublicEndpoint[I, E, O, R], baseUri: Option[Uri], backend: SttpBackend[F, R])(implicit
20+
def toClient[F[_], I, E, O, R](e: PublicEndpoint[I, E, O, R], baseUri: Option[Uri], backend: Backend[F])(implicit
2121
wsToPipe: WebSocketToPipe[R]
2222
): I => F[DecodeResult[Either[E, O]]] = {
23-
val req = toRequest(e, baseUri)
24-
(i: I) => backend.responseMonad.map(backend.send(req(i)))(_.body)
23+
(i: I) =>
24+
val req = toRequest(e, baseUri)
25+
backend.monad.map(req(i).send(backend))(_.body)
2526
}
2627

2728
/** Interprets the public endpoint as a client call, using the given `baseUri` as the starting point to create the target uri. If
@@ -31,11 +32,11 @@ trait SttpClientInterpreter extends SttpClientInterpreterExtensions {
3132
* parameters: path, query, headers and body. The request is sent using the given backend, and the result (error or success value) is
3233
* returned. If decoding the result fails, a failed effect is returned instead.
3334
*/
34-
def toClientThrowDecodeFailures[F[_], I, E, O, R](e: PublicEndpoint[I, E, O, R], baseUri: Option[Uri], backend: SttpBackend[F, R])(
35+
def toClientThrowDecodeFailures[F[_], I, E, O, R](e: PublicEndpoint[I, E, O, R], baseUri: Option[Uri], backend: Backend[F])(
3536
implicit wsToPipe: WebSocketToPipe[R]
3637
): I => F[Either[E, O]] = {
3738
val req = toRequestThrowDecodeFailures(e, baseUri)
38-
(i: I) => backend.responseMonad.map(backend.send(req(i)))(_.body)
39+
(i: I) => backend.monad.map(req(i).send(backend))(_.body)
3940
}
4041

4142
/** Interprets the public endpoint as a client call, using the given `baseUri` as the starting point to create the target uri. If
@@ -45,11 +46,11 @@ trait SttpClientInterpreter extends SttpClientInterpreterExtensions {
4546
* parameters: path, query, headers and body. The request is sent using the given backend, and the result (success value) is returned. If
4647
* decoding the result fails, or if the response corresponds to an error value, a failed effect is returned instead.
4748
*/
48-
def toClientThrowErrors[F[_], I, E, O, R](e: PublicEndpoint[I, E, O, R], baseUri: Option[Uri], backend: SttpBackend[F, R])(implicit
49+
def toClientThrowErrors[F[_], I, E, O, R](e: PublicEndpoint[I, E, O, R], baseUri: Option[Uri], backend: Backend[F])(implicit
4950
wsToPipe: WebSocketToPipe[R]
5051
): I => F[O] = {
5152
val req = toRequestThrowErrors(e, baseUri)
52-
(i: I) => backend.responseMonad.map(backend.send(req(i)))(_.body)
53+
(i: I) => backend.monad.map(req(i).send(backend))(_.body)
5354
}
5455

5556
/** Interprets the public endpoint as a client call, using the given `baseUri` as the starting point to create the target uri. If
@@ -62,8 +63,9 @@ trait SttpClientInterpreter extends SttpClientInterpreterExtensions {
6263
*/
6364
def toRequest[I, E, O, R](e: PublicEndpoint[I, E, O, R], baseUri: Option[Uri])(implicit
6465
wsToPipe: WebSocketToPipe[R]
65-
): I => Request[DecodeResult[Either[E, O]], R] =
66+
): I => Request[DecodeResult[Either[E, O]]] = {
6667
new EndpointToSttpClient(sttpClientOptions, wsToPipe).toSttpRequest(e, baseUri).apply(())
68+
}
6769

6870
/** Interprets the public endpoint as a client call, using the given `baseUri` as the starting point to create the target uri. If
6971
* `baseUri` is not provided, the request will be a relative one.
@@ -75,7 +77,7 @@ trait SttpClientInterpreter extends SttpClientInterpreterExtensions {
7577
*/
7678
def toRequestThrowDecodeFailures[I, E, O, R](e: PublicEndpoint[I, E, O, R], baseUri: Option[Uri])(implicit
7779
wsToPipe: WebSocketToPipe[R]
78-
): I => Request[Either[E, O], R] =
80+
): I => Request[Either[E, O]] =
7981
i => new EndpointToSttpClient(sttpClientOptions, wsToPipe).toSttpRequest(e, baseUri).apply(()).apply(i).mapResponse(throwDecodeFailures)
8082

8183
/** Interprets the public endpoint as a client call, using the given `baseUri` as the starting point to create the target uri. If
@@ -91,7 +93,7 @@ trait SttpClientInterpreter extends SttpClientInterpreterExtensions {
9193
*/
9294
def toRequestThrowErrors[I, E, O, R](e: PublicEndpoint[I, E, O, R], baseUri: Option[Uri])(implicit
9395
wsToPipe: WebSocketToPipe[R]
94-
): I => Request[O, R] =
96+
): I => Request[O] =
9597
i =>
9698
new EndpointToSttpClient(sttpClientOptions, wsToPipe)
9799
.toSttpRequest(e, baseUri)
@@ -113,11 +115,11 @@ trait SttpClientInterpreter extends SttpClientInterpreterExtensions {
113115
* appropriate request parameters: path, query, headers and body. The request is sent using the given backend, and the result of decoding
114116
* the response (error or success value) is returned.
115117
*/
116-
def toSecureClient[F[_], A, I, E, O, R](e: Endpoint[A, I, E, O, R], baseUri: Option[Uri], backend: SttpBackend[F, R])(implicit
118+
def toSecureClient[F[_], A, I, E, O, R](e: Endpoint[A, I, E, O, R], baseUri: Option[Uri], backend: Backend[F])(implicit
117119
wsToPipe: WebSocketToPipe[R]
118120
): A => I => F[DecodeResult[Either[E, O]]] = {
119121
val req = toSecureRequest(e, baseUri)
120-
(a: A) => (i: I) => backend.responseMonad.map(backend.send(req(a)(i)))(_.body)
122+
(a: A) => (i: I) => backend.monad.map(backend.send(req(a)(i)))(_.body)
121123
}
122124

123125
/** Interprets the secure endpoint as a client call, using the given `baseUri` as the starting point to create the target uri. If
@@ -127,11 +129,11 @@ trait SttpClientInterpreter extends SttpClientInterpreterExtensions {
127129
* appropriate request parameters: path, query, headers and body. The request is sent using the given backend, and the result (error or
128130
* success value) is returned. If decoding the result fails, a failed effect is returned instead.
129131
*/
130-
def toSecureClientThrowDecodeFailures[F[_], A, I, E, O, R](e: Endpoint[A, I, E, O, R], baseUri: Option[Uri], backend: SttpBackend[F, R])(
132+
def toSecureClientThrowDecodeFailures[F[_], A, I, E, O, R](e: Endpoint[A, I, E, O, R], baseUri: Option[Uri], backend: Backend[F])(
131133
implicit wsToPipe: WebSocketToPipe[R]
132134
): A => I => F[Either[E, O]] = {
133135
val req = toSecureRequestThrowDecodeFailures(e, baseUri)
134-
(a: A) => (i: I) => backend.responseMonad.map(backend.send(req(a)(i)))(_.body)
136+
(a: A) => (i: I) => backend.monad.map(backend.send(req(a)(i)))(_.body)
135137
}
136138

137139
/** Interprets the secure endpoint as a client call, using the given `baseUri` as the starting point to create the target uri. If
@@ -142,11 +144,11 @@ trait SttpClientInterpreter extends SttpClientInterpreterExtensions {
142144
* value) is returned. If decoding the result fails, or if the response corresponds to an error value, a failed effect is returned
143145
* instead.
144146
*/
145-
def toSecureClientThrowErrors[F[_], A, I, E, O, R](e: Endpoint[A, I, E, O, R], baseUri: Option[Uri], backend: SttpBackend[F, R])(implicit
147+
def toSecureClientThrowErrors[F[_], A, I, E, O, R](e: Endpoint[A, I, E, O, R], baseUri: Option[Uri], backend: Backend[F])(implicit
146148
wsToPipe: WebSocketToPipe[R]
147149
): A => I => F[O] = {
148150
val req = toSecureRequestThrowErrors(e, baseUri)
149-
(a: A) => (i: I) => backend.responseMonad.map(backend.send(req(a)(i)))(_.body)
151+
(a: A) => (i: I) => backend.monad.map(backend.send(req(a)(i)))(_.body)
150152
}
151153

152154
/** Interprets the secure endpoint as a client call, using the given `baseUri` as the starting point to create the target uri. If
@@ -159,7 +161,7 @@ trait SttpClientInterpreter extends SttpClientInterpreterExtensions {
159161
*/
160162
def toSecureRequest[A, I, E, O, R](e: Endpoint[A, I, E, O, R], baseUri: Option[Uri])(implicit
161163
wsToPipe: WebSocketToPipe[R]
162-
): A => I => Request[DecodeResult[Either[E, O]], R] =
164+
): A => I => Request[DecodeResult[Either[E, O]]] =
163165
new EndpointToSttpClient(sttpClientOptions, wsToPipe).toSttpRequest(e, baseUri)
164166

165167
/** Interprets the secure endpoint as a client call, using the given `baseUri` as the starting point to create the target uri. If
@@ -172,7 +174,7 @@ trait SttpClientInterpreter extends SttpClientInterpreterExtensions {
172174
*/
173175
def toSecureRequestThrowDecodeFailures[A, I, E, O, R](e: Endpoint[A, I, E, O, R], baseUri: Option[Uri])(implicit
174176
wsToPipe: WebSocketToPipe[R]
175-
): A => I => Request[Either[E, O], R] =
177+
): A => I => Request[Either[E, O]] =
176178
a =>
177179
i =>
178180
new EndpointToSttpClient(sttpClientOptions, wsToPipe).toSttpRequest(e, baseUri).apply(a).apply(i).mapResponse(throwDecodeFailures)
@@ -190,7 +192,7 @@ trait SttpClientInterpreter extends SttpClientInterpreterExtensions {
190192
*/
191193
def toSecureRequestThrowErrors[A, I, E, O, R](e: Endpoint[A, I, E, O, R], baseUri: Option[Uri])(implicit
192194
wsToPipe: WebSocketToPipe[R]
193-
): A => I => Request[O, R] =
195+
): A => I => Request[O] =
194196
a =>
195197
i =>
196198
new EndpointToSttpClient(sttpClientOptions, wsToPipe)

client/sttp-client4/src/main/scala/sttp/tapir/client/sttp/SttpClientOptions.scala renamed to client/sttp-client4/src/main/scala/sttp/tapir/client/sttp4/SttpClientOptions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package sttp.tapir.client.sttp
1+
package sttp.tapir.client.sttp4
22

33
import sttp.tapir.{Defaults, TapirFile}
44

client/sttp-client4/src/main/scala/sttp/tapir/client/sttp/WebSocketToPipe.scala renamed to client/sttp-client4/src/main/scala/sttp/tapir/client/sttp4/WebSocketToPipe.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package sttp.tapir.client.sttp
1+
package sttp.tapir.client.sttp4
22

33
import sttp.capabilities.Streams
44
import sttp.tapir.WebSocketBodyOutput

client/sttp-client4/src/main/scalajs/sttp/tapir/client/sttp/EndpointToSttpClientExtensions.scala renamed to client/sttp-client4/src/main/scalajs/sttp/tapir/client/sttp4/EndpointToSttpClientExtensions.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package sttp.tapir.client.sttp
1+
package sttp.tapir.client.sttp4
22

33
import sttp.model.StatusCode
44

5-
private[sttp] trait EndpointToSttpClientExtensions { this: EndpointToSttpClient[_] =>
5+
private[sttp4] trait EndpointToSttpClientExtensions { this: EndpointToSttpClient[_] =>
66

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

client/sttp-client4/src/main/scalajs/sttp/tapir/client/sttp/SttpClientInterpreterExtensions.scala renamed to client/sttp-client4/src/main/scalajs/sttp/tapir/client/sttp4/SttpClientInterpreterExtensions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package sttp.tapir.client.sttp
1+
package sttp.tapir.client.sttp4
22

33
import sttp.client3.{FetchBackend, SttpBackend}
44
import sttp.model.Uri
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package sttp.tapir.client.sttp.ws.fs2
1+
package sttp.tapir.client.sttp4.ws.fs2
22

33
import cats.effect.Concurrent
44
import sttp.capabilities.WebSockets

client/sttp-client4/src/main/scalajvm/sttp/tapir/client/sttp/ws/fs2/WebSocketToFs2Pipe.scala renamed to client/sttp-client4/src/main/scalajs/sttp/tapir/client/sttp4/ws/fs2/WebSocketToFs2Pipe.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package sttp.tapir.client.sttp.ws.fs2
1+
package sttp.tapir.client.sttp4.ws.fs2
22

33
import _root_.fs2._
44
import cats.MonadError
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
package sttp.tapir.client.sttp.ws
1+
package sttp.tapir.client.sttp4.ws
22

33
package object fs2 extends TapirSttpClientFs2WebSockets
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package sttp.tapir.client.sttp.ws.zio
1+
package sttp.tapir.client.sttp4.ws.zio
22

33
import sttp.capabilities.WebSockets
44
import sttp.capabilities.zio.ZioStreams

client/sttp-client4/src/main/scalajs/sttp/tapir/client/sttp/ws/zio/WebSocketToZioPipe.scala renamed to client/sttp-client4/src/main/scalajs/sttp/tapir/client/sttp4/ws/zio/WebSocketToZioPipe.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package sttp.tapir.client.sttp.ws.zio
1+
package sttp.tapir.client.sttp4.ws.zio
22

33
import sttp.capabilities.WebSockets
44
import sttp.capabilities.zio.ZioStreams
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
package sttp.tapir.client.sttp.ws
1+
package sttp.tapir.client.sttp4.ws
22

33
package object zio extends TapirSttpClientZioWebSockets

0 commit comments

Comments
 (0)