This file contains hidden or 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
| opaque type NonEmptyString = String | |
| object NonEmptyString: | |
| def apply(s: String): Option[NonEmptyString] = | |
| if s.isEmpty then None else Some(s) |
This file contains hidden or 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
| "pool-48-thread-5" #225 prio=5 os_prio=31 cpu=172535.04ms elapsed=180.55s tid=0x00007fd765e3d800 nid=0xdd0b runnable [0x0000700019eb4000] | |
| java.lang.Thread.State: RUNNABLE | |
| at dotty.tools.dotc.core.Types$Type.classSymbol(Types.scala:488) | |
| at dotty.tools.dotc.transform.patmat.SpaceEngine.canDecompose(Space.scala:649) | |
| at dotty.tools.dotc.transform.patmat.SpaceLogic.simplify(Space.scala:147) | |
| at dotty.tools.dotc.transform.patmat.SpaceLogic.simplify$(Space.scala:78) | |
| at dotty.tools.dotc.transform.patmat.SpaceEngine.simplify(Space.scala:323) | |
| at dotty.tools.dotc.transform.patmat.SpaceLogic.isSubspace(Space.scala:176) | |
| at dotty.tools.dotc.transform.patmat.SpaceLogic.isSubspace$(Space.scala:78) | |
| at dotty.tools.dotc.transform.patmat.SpaceEngine.isSubspace(Space.scala:323) |
This file contains hidden or 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 cats.effect._ | |
| import cats.syntax.all._ | |
| import org.http4s.HttpRoutes | |
| import org.http4s.server.Router | |
| import org.http4s.server.blaze.BlazeServerBuilder | |
| import org.http4s.syntax.kleisli._ | |
| import sttp.client3._ | |
| import sttp.tapir._ |
This file contains hidden or 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
| trait TapirHandler extends RequestStreamHandler { | |
| def endpoints: List[ServerEndpoint[_, _, _, Any, Identity]] | |
| override def handleRequest(input: InputStream, output: OutputStream, | |
| context: Context): Unit = { | |
| val json = new String(input.readAllBytes(), UTF_8) | |
| val writer = new BufferedWriter(new OutputStreamWriter(output, UTF_8)) | |
| writer.write(handleRequest(json)) | |
| writer.flush() | |
| } |
This file contains hidden or 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
| asyncapi: 2.0.0 | |
| info: | |
| title: JSON echo | |
| version: '1.0' | |
| servers: | |
| dev: | |
| url: localhost:8080 | |
| protocol: ws | |
| channels: | |
| /ping: |
This file contains hidden or 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
| import monix.reactive.Observable | |
| import sttp.capabilities.monix.MonixStreams | |
| object Test extends App { | |
| import sttp.client3._ | |
| import monix.execution.Scheduler.Implicits.global | |
| val b = AsyncHttpClientMonixBackend().runSyncUnsafe() | |
| basicRequest.post(uri"http://198.51.100.0").streamBody(MonixStreams)(Observable.empty).send(b).runSyncUnsafe() |
This file contains hidden or 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.server.http4s.ztapir | |
| import org.scalatest.flatspec.AnyFlatSpec | |
| import org.scalatest.matchers.should.Matchers | |
| import sttp.monad.MonadError | |
| import zio.{Has, RIO, Runtime, ZIO} | |
| import zio.interop.catz._ | |
| import zio.interop.catz.implicits._ | |
| import sttp.tapir._ | |
| import sttp.tapir.server.ServerEndpoint |
This file contains hidden or 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.client3.examples | |
| import monix.eval.Task | |
| import sttp.capabilities.WebSockets | |
| import sttp.capabilities.monix.MonixStreams | |
| import sttp.client3._ | |
| import sttp.client3.asynchttpclient.monix.AsyncHttpClientMonixBackend | |
| import sttp.client3.testing.SttpBackendStub | |
| import sttp.model.StatusCode | |
| import sttp.ws.{WebSocket, WebSocketFrame} |
This file contains hidden or 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.client3.examples | |
| import io.circe.generic.auto._ | |
| import sttp.client3._ | |
| import sttp.client3.asynchttpclient.monix.AsyncHttpClientMonixBackend | |
| import sttp.client3.circe._ | |
| object GetAndParseJsonGetRightMonixCirce extends App { | |
| import monix.execution.Scheduler.Implicits.global |
This file contains hidden or 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.client3.examples | |
| import io.circe | |
| import io.circe.generic.auto._ | |
| import sttp.client3._ | |
| import sttp.client3.circe._ | |
| object GetRawRequestBodySynchronous extends App { | |
| case class HttpBinResponse(origin: String, headers: Map[String, String]) |