We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
4.0.7
3.4.1, 3.3.3
8, 11, 17, 21
see https://scastie.scala-lang.org/kNYNFfjiS32A8oLJ7VR9pA
case class Example(elem: String) extends AnyVal case object ExampleSerializer extends CustomSerializer[Example](_ => ( { case JString(s) => Example(s) }, { case Example(s) => JString(s) }, ), ) case class Outer(examples: List[Example]) implicit val formats: Formats = DefaultFormats + ExampleSerializer val in = read[Outer](write(o)) val firstExample: Example = in.examples.head // class java.lang.String cannot be cast to class Example
Removing the AnyVal makes this work again.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
json4s version
4.0.7
scala version
3.4.1, 3.3.3
jdk version
8, 11, 17, 21
see https://scastie.scala-lang.org/kNYNFfjiS32A8oLJ7VR9pA
Removing the AnyVal makes this work again.
The text was updated successfully, but these errors were encountered: