Skip to content

Commit

Permalink
Remove effect covariance as it was affecting 2.12.x
Browse files Browse the repository at this point in the history
  • Loading branch information
cfernandescaesars committed Jun 21, 2023
1 parent 22d5e65 commit 8e855f0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
6 changes: 4 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ inThisBuild {

ThisBuild / scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12 | 13)) =>
Seq(
case Some((2, minor @ (12 | 13))) =>
val base = Seq(
"-deprecation",
"-encoding",
"UTF-8",
Expand All @@ -57,6 +57,8 @@ ThisBuild / scalacOptions ++= {
"-Ywarn-unused",
"-Xsource:3"
)
if (minor == 12) "-Ypartial-unification" +: base
else base

case Some((3, _)) =>
Seq.empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,23 @@ import scala.reflect.ClassTag

// See AbstractKafkaJsonSchemaDeserializer
object JsonSchemaDeserializer {
def forValue[F[+_]: Sync, A: Decoder](
def forValue[F[_]: Sync, A: Decoder](
settings: JsonSchemaDeserializerSettings,
client: SchemaRegistryClient
)(implicit jsonSchema: json.Schema[A], tag: ClassTag[A]): F[ValueDeserializer[F, A]] =
toJsonSchema[F, A](jsonSchema, settings.jsonSchemaId)
.flatMap(create(settings, client, _))
.map(identity)

def forKey[F[+_]: Sync, A: Decoder](
def forKey[F[_]: Sync, A: Decoder](
settings: JsonSchemaDeserializerSettings,
client: SchemaRegistryClient
)(implicit jsonSchema: json.Schema[A], tag: ClassTag[A]): F[KeyDeserializer[F, A]] =
toJsonSchema[F, A](jsonSchema, settings.jsonSchemaId)
.flatMap(create(settings, client, _))
.map(identity)

def create[F[+_]: Sync, A: Decoder](
def create[F[_]: Sync, A: Decoder](
settings: JsonSchemaDeserializerSettings,
client: SchemaRegistryClient,
schema: JsonSchema
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package io.kaizensolutions.jsonschema

import cats.effect._
import cats.syntax.all._
import cats.effect.*
import cats.syntax.all.*
import com.dimafeng.testcontainers.DockerComposeContainer.ComposeFile
import com.dimafeng.testcontainers.munit.TestContainersForAll
import com.dimafeng.testcontainers.{DockerComposeContainer, ExposedService}
import fs2.Stream
import fs2.kafka._
import fs2.kafka.*
import fs2.kafka.vulcan.SchemaRegistryClientSettings
import io.circe.generic.semiauto._
import io.circe.generic.semiauto.*
import io.circe.{Codec, Decoder, Encoder}
import io.confluent.kafka.schemaregistry.client.SchemaRegistryClient
import io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException
Expand Down Expand Up @@ -232,7 +232,7 @@ class JsonSchemaSerDesSpec extends CatsEffectSuite with TestContainersForAll {
assertion(produceElements)
}

def consumeFromKafka[F[+_]: Async, A: Decoder: json.Schema: ClassTag](
def consumeFromKafka[F[_]: Async, A: Decoder: json.Schema: ClassTag](
fClient: F[SchemaRegistryClient],
settings: JsonSchemaDeserializerSettings,
groupId: String,
Expand Down

0 comments on commit 8e855f0

Please sign in to comment.