-
Notifications
You must be signed in to change notification settings - Fork 147
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
Unable to locate the JsonDecoder for a type constructor containing a nested type. #1128
Comments
/bounty $200 |
|
/attempt #1128 Options |
@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 |
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
}
|
Hi, this issue seems stale so I gave it a shot. What I found out:
What I did:
/attempt #1128
|
💡 @ifndev submitted a pull request that claims the bounty. You can visit your bounty board to reward. |
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 the
Id.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.The text was updated successfully, but these errors were encountered: