-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Class java.math.BigDecimal cannot be cast to class scala.math.BigDecimal in schema-bson #663
Labels
Comments
/bounty $50 |
💎 $50 bounty • ZIOSteps to solve:
Thank you for contributing to zio/zio-schema! Add a bounty • Share on socials
|
💡 @abhishek818 submitted a pull request that claims the bounty. You can visit your bounty board to reward. |
abhishek818
added a commit
to abhishek818/zio-schema
that referenced
this issue
Jun 8, 2024
refer the codec defintion in zio-bson repo : zio/zio-bson/src/main/scala/zio/bson/BsonCodec.scala#L80
abhishek818
added a commit
to abhishek818/zio-schema
that referenced
this issue
Jun 12, 2024
abhishek818
added a commit
to abhishek818/zio-schema
that referenced
this issue
Jun 12, 2024
refer the codec defintion in zio-bson repo : zio/zio-bson/src/main/scala/zio/bson/BsonCodec.scala#L80
abhishek818
added a commit
to abhishek818/zio-schema
that referenced
this issue
Jun 12, 2024
abhishek818
added a commit
to abhishek818/zio-schema
that referenced
this issue
Jun 12, 2024
jdegoes
pushed a commit
that referenced
this issue
Jun 12, 2024
🎉🎈 @abhishek818 has been awarded $50! 🎈🎊 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: