You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to make a rest api with zio ecosystem and mongoDB.
When I tring to encode scala.math.BigDecimal in mongoDB, I have this error =>
class java.math.BigDecimal cannot be cast to class scala.math.BigDecimal (java.math.BigDecimal is in module java.base of loader 'bootstrap'; scala.math.BigDecimal is in unnamed module of loader 'app')
I changed
case StandardType.BigDecimalType => BsonCodec.bigDecimal.asInstanceOf[BsonCodec[A]]
to
case StandardType.BigDecimalType => BsonCodec.javaBigDecimal.asInstanceOf[BsonCodec[A]]
Hello,
I'm trying to make a rest api with zio ecosystem and mongoDB.
When I tring to encode
scala.math.BigDecimal
in mongoDB, I have this error =>class java.math.BigDecimal cannot be cast to class scala.math.BigDecimal (java.math.BigDecimal is in module java.base of loader 'bootstrap'; scala.math.BigDecimal is in unnamed module of loader 'app')
I changed
case StandardType.BigDecimalType => BsonCodec.bigDecimal.asInstanceOf[BsonCodec[A]]
to
case StandardType.BigDecimalType => BsonCodec.javaBigDecimal.asInstanceOf[BsonCodec[A]]
zio-schema/zio-schema-bson/src/main/scala/zio/schema/codec/BsonSchemaCodec.scala
Line 414 in 276b2e6
And this solved the problem
The text was updated successfully, but these errors were encountered: