zio / zio-schema

Compositional, type-safe schema definitions, which enable auto-derivation of codecs and migrations.
https://zio.dev/zio-schema
Apache License 2.0
142 stars 162 forks source link

bin-compat issue in `v1.5.0`? #744

Open jivanic-demystdata opened 2 months ago

jivanic-demystdata commented 2 months ago

We have errors like this in the CI of the PR updating zio-schema (probably a bin-compat issue with the version used in zio-http v3.0.1)

 Exception in thread "zio-fiber-4971" java.lang.NoClassDefFoundError: Could not initialize class com.company.v2.api.MyApis$
        at com.company.v2.api..MySpec$.$anonfun$14$$anonfun$3(MySpec.scala:143)
        at com.company.v2.api..MySpec.spec(MySpec.scala:141)
        at com.company.v2.api..MySpec.spec(MySpec.scala:133)
        at com.company.v2.api..MySpec.spec(MySpec.scala:155)
        Suppressed: java.lang.ExceptionInInitializerError: Exception java.lang.NoSuchMethodError: 'zio.schema.codec.JsonCodec$Config zio.schema.codec.JsonCodec$Config$.apply(boolean)' [in thread "ZScheduler-Worker-0"]
            at zio.http.codec.HttpContentCodec$json$.$anonfun$1(HttpContentCodec.scala:287)
            at zio.http.codec.BinaryCodecWithSchema.codec$$anonfun$1(BinaryCodecWithSchema.scala:15)
            at scala.collection.immutable.Map$EmptyMap$.getOrElse(Map.scala:246)
            at zio.http.codec.BinaryCodecWithSchema.codec(BinaryCodecWithSchema.scala:18)
            at zio.http.codec.HttpContentCodec.$init$$$anonfun$3(HttpContentCodec.scala:135)
            at scala.Option.map(Option.scala:242)
            at zio.http.codec.HttpContentCodec.$init$(HttpContentCodec.scala:135)
            at zio.http.codec.HttpContentCodec$Choices.<init>(HttpContentCodec.scala:150)
            at zio.http.codec.HttpContentCodec$Choices$.apply(HttpContentCodec.scala:150)
            at zio.http.codec.HttpContentCodec$json$.only(HttpContentCodec.scala:289)
            at zio.http.codec.HttpContentCodec$.fromSchema(HttpContentCodec.scala:268)
            at zio.http.codec.HttpCodec$.error(HttpCodec.scala:336)
            at com.company.v2.api.MyEndpoints$.<clinit>(MyEndpoints.scala:45)
            at com.company.v2.api.MyApis$.<clinit>(MyApis.scala:31)
            at com.company.v2.api..MyApis$.$anonfun$2$$anonfun$3(MyApis.scala:66)

The MyEndpoints object contains our zio-http endpoints definitions The MyApis object contains the implementation of these endpoints

Cc @guizmaii

987Nabil commented 2 months ago

Yes, the config has a new field. We should enable mima and use the unroll lib for the config.