-
-
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
Missing keys exception using Option with generic #545
Comments
Seems like a bug in the Scala 3 macros, the Scala 2 equivalent seems to work import upickle.implicits.key
case class Person(id: Int, name: String = "test")
implicit val personRw = upickle.default.macroRW[Person]
case class ApiResult[T](data: Option[T] = None, @key("total_count") totalCount: Int)
implicit def apiResultRw[T: upickle.default.ReadWriter] = upickle.default.macroRW[ApiResult[T]]
println(upickle.default.read[Person]("{\"id\":1}")) // OK
println(upickle.default.read[ApiResult[Person]]("{\"total_count\": 10}")) // Works |
The problem appears to be that |
@mobilemindtec This fix should have gone out in the latest version 3.1.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
I'm getting a missing keys exception when key is a option generic field. Example:
Is there a way to get around this?
The text was updated successfully, but these errors were encountered: