We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
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
Convert [] as None is the default behavior of upickle, and per document I managed to convert null to None by using an customized upickle
object OptionPickler extends upickle.AttributeTagged { override implicit def OptionWriter[T: Writer]: Writer[Option[T]] = implicitly[Writer[T]].comap[Option[T]] { case None => null.asInstanceOf[T] case Some(x) => x } override implicit def OptionReader[T: Reader]: Reader[Option[T]] = { new Reader.Delegate[Any, Option[T]](implicitly[Reader[T]].map(Some(_))){ override def visitNull(index: Int) = None } } }
How to make a custom upickle that can convert both null and [] to None?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Convert [] as None is the default behavior of upickle, and per document I managed to convert null to None by using an customized upickle
How to make a custom upickle that can convert both null and [] to None?
The text was updated successfully, but these errors were encountered: