This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//> using dep "com.softwaremill.sttp.client3::zio:3.8.15" | |
//> using dep "com.softwaremill.sttp.client3::slf4j-backend:3.8.15" | |
//> using dep "ch.qos.logback:logback-classic:1.4.7" | |
import org.slf4j.LoggerFactory | |
import sttp.client3.httpclient.zio.HttpClientZioBackend | |
import sttp.client3._ | |
import sttp.client3.logging.slf4j.Slf4jLoggingBackend | |
import sttp.client3.logging.LogLevel | |
import sttp.capabilities.WebSockets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it should "succeed when it finishes shortly before the timeout" in { | |
// given | |
val slowService = new SlowService(responseTimes = List(2800.millis)) | |
val service = new TimeoutService(slowService) // 3s | |
// when | |
val result = service.run().unsafeToFuture() | |
ec.tick(TimeoutService.DefaultTimeout) // 3s forward in time! | |
// then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.softwaremill | |
import sttp.model.StatusCode | |
import sttp.monad.MonadError | |
import sttp.monad.syntax._ | |
import sttp.tapir.AttributeKey | |
import sttp.tapir.server.interceptor.* | |
import sttp.tapir.server.interpreter.BodyListener | |
import sttp.tapir.server.model.ServerResponse | |
import sttp.tapir.server.ziohttp.{ZioHttpInterpreter, ZioHttpServerOptions} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//> using scala 3.3.1 | |
//> using dep com.softwaremill.sttp.tapir::tapir-netty-server:1.8.0 | |
//> using dep com.softwaremill.sttp.tapir::tapir-swagger-ui-bundle:1.8.0 | |
//> using dep com.softwaremill.sttp.tapir::tapir-json-circe:1.8.0 | |
package com.softwaremill | |
import sttp.tapir.* | |
import DragonApi.* | |
import ResponseApi.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sttp.tapir.examples | |
import akka.actor.ActorSystem | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.server.Route | |
import sttp.tapir._ | |
import sttp.tapir.json.circe._ | |
import io.circe.generic.auto._ | |
import sttp.tapir.generic.auto._ | |
import sttp.tapir.server.akkahttp.AkkaHttpServerOptions |
OlderNewer