Closed wi101 closed 1 month ago
/bounty $200
## 💎 $200 bounty • ZIO
### Steps to solve:
1. Start working: Comment
/attempt #1128
with your implementation plan2. Submit work: Create a pull request including
/claim #1128
in the PR body to claim the bounty3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts
Thank you for contributing to zio/zio-json!
Add a bounty • Share on socials
Attempt | Started (GMT+0) | Solution |
---|---|---|
🔴 @Anshgrover23 | Jun 28, 2024, 4:11:00 PM | WIP |
🔴 @omarnagy91 | Jul 9, 2024, 4:58:42 AM | WIP |
🟢 @ifndev | Jul 29, 2024, 1:45:06 PM | #1139 |
/attempt #1128
@wi101 I am unable to reproduce What Scala version are you using? Are the definitions all in the same file? Are you sure you have no conflicting versions in your project?
/attempt #1128
@987Nabil
This is the full example (the same file)
import zio.json.{DeriveJsonDecoder, JsonDecoder}
final case class Id[A](value: A)
object Id {
implicit def decoder[A: JsonDecoder]: JsonDecoder[Id[A]] = DeriveJsonDecoder.gen[Id[A]]
}
final case class Person(name: String) extends AnyVal
object Person {
implicit val decoder: JsonDecoder[Person] = DeriveJsonDecoder.gen
}
final case class People(ids: Id[Person])
object People {
implicit val decoder: JsonDecoder[People] = DeriveJsonDecoder.gen
}
scalaVersion: 2.13.14
zioJsonVersion: 0.7.0
Hi, this issue seems stale so I gave it a shot.
/attempt #1128
Algora profile | Completed bounties | Tech | Active attempts | Options |
---|---|---|---|---|
@ifndev | 1 bounty from 1 project | Python, C++, TypeScript & more |
Cancel attempt |
💡 @ifndev submitted a pull request that claims the bounty. You can visit your bounty board to reward.
Just submitted PR #1139
It's based on the assumption that making the 'encoder' parameter implicit was a mistake, so it may be wrong. Ideally, adding a test for a specific case covered by PR #1115 would be a good idea.
Let me know if I missed something :)
Hey, when can we expect the PR to be merged? I am working on an implementation that depends on this fix.
🎉🎈 @ifndev has been awarded $200! 🎈🎊
Hello,
This issue appeared when updating to zio-json:
0.7.0
. Here is an example:Error:
People.decoder
cannot find the decoder forId[Person]
. There is an issue on finding theId.decoder
..when we manually add the decoder to
Id
companion object:The same error appears. But it works only when we add that decoder to
People
companion.