Skip to content

Commit

Permalink
Fix tapir module
Browse files Browse the repository at this point in the history
  • Loading branch information
danslapman committed Sep 21, 2024
1 parent 752e998 commit 27025b5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
22 changes: 14 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ lazy val `morphling-scalacheck` = (projectMatrix in file("scalacheck"))
"org.scalacheck" %% "scalacheck" % versions("scalacheck")
),
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, y)) =>
case Some((2, _)) =>
Seq("io.github.leviysoft" %% "simulacrum" % versions("simulacrum"))
case _ =>
Seq("org.typelevel" %% "simulacrum-scalafix-annotations" % versions("simulacrum-scalafix-annotations"))
Expand Down Expand Up @@ -84,7 +84,7 @@ lazy val `morphling-circe` = (projectMatrix in file("circe"))
"org.scalatestplus" %% "scalacheck-1-15" % versions("scalatestplus-scalacheck") % Test
),
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, y)) =>
case Some((2, _)) =>
Seq("io.github.leviysoft" %% "simulacrum" % versions("simulacrum"))
case _ =>
Seq("org.typelevel" %% "simulacrum-scalafix-annotations" % versions("simulacrum-scalafix-annotations"))
Expand All @@ -104,7 +104,7 @@ lazy val `morphling-circe` = (projectMatrix in file("circe"))
compilerPlugin("org.scalamacros" % "paradise" % versions("paradise") cross CrossVersion.full),
compilerPlugin("com.olegpy" %% "better-monadic-for" % versions("bm4"))
)
case Some((2, y)) =>
case Some((2, _)) =>
Seq(
compilerPlugin("com.olegpy" %% "better-monadic-for" % versions("bm4"))
)
Expand All @@ -128,7 +128,7 @@ lazy val `morphling-reactivemongo` = (projectMatrix in file("reactivemongo"))
"org.scalatestplus" %% "scalacheck-1-15" % versions("scalatestplus-scalacheck") % Test
),
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, y)) =>
case Some((2, _)) =>
Seq("io.github.leviysoft" %% "simulacrum" % versions("simulacrum"))
case _ =>
Seq("org.typelevel" %% "simulacrum-scalafix-annotations" % versions("simulacrum-scalafix-annotations"))
Expand All @@ -151,7 +151,7 @@ lazy val `morphling-reactivemongo` = (projectMatrix in file("reactivemongo"))
compilerPlugin("org.scalamacros" % "paradise" % versions("paradise") cross CrossVersion.full),
compilerPlugin("com.olegpy" %% "better-monadic-for" % versions("bm4"))
)
case Some((2, y)) =>
case Some((2, _)) =>
Seq(
compilerPlugin("com.olegpy" %% "better-monadic-for" % versions("bm4"))
)
Expand All @@ -175,10 +175,10 @@ lazy val `morphling-typed-schema` = (projectMatrix in file("typedschema"))
"org.scalaz" %% "scalaz-core" % "7.2.29" % Test
),
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, y)) =>
case Some((2, _)) =>
Seq("io.github.leviysoft" %% "simulacrum" % versions("simulacrum"))
case _ =>
Seq("org.typelevel" %% "simulacrum-scalafix-annotations" % versions("simulacrum-scalafix-annotations"))
Seq.empty[ModuleID]
}),
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, y)) if y < 13 =>
Expand Down Expand Up @@ -206,10 +206,16 @@ lazy val `morphling-tapir` = (projectMatrix in file("tapir"))
"com.softwaremill.sttp.apispec" %% "openapi-circe" % "0.2.1" % Test
),
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, y)) =>
case Some((2, _)) =>
Seq("io.github.leviysoft" %% "simulacrum" % versions("simulacrum"))
case _ =>
Seq("org.typelevel" %% "simulacrum-scalafix-annotations" % versions("simulacrum-scalafix-annotations"))
}),
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, y)) if y < 13 =>
Seq(compilerPlugin("org.scalamacros" % "paradise" % versions("paradise") cross CrossVersion.full))
case _ =>
Seq.empty[ModuleID]
})
)

Expand Down
4 changes: 2 additions & 2 deletions tapir/src/main/scala-2/morphling/tapir/ToSchema.scala
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ object ToSchema {
override val toSchema: EitherK[P, Q, *] ~> TapirSchema =
new (EitherK[P, Q, *] ~> TapirSchema) {
override def apply[A](fa: EitherK[P, Q, A]): TapirSchema[A] = fa.run.fold(
ToSchema[P].toSchema(_),
ToSchema[Q].toSchema(_),
ToSchema.apply[P].toSchema(_),
ToSchema.apply[Q].toSchema(_),
)
}
}
Expand Down

0 comments on commit 27025b5

Please sign in to comment.