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
Here is a code snippet that works fine using 9.0.0 but fails with stack overflow using 10.0.1:
import julienrf.json.derived.flat import play.api.libs.functional.syntax._ import play.api.libs.json._ sealed trait ADTBase extends Product with Serializable case class X(a: Int) extends ADTBase case class Y(b: String) extends ADTBase case class Z(l: ADTBase, r: ADTBase) extends ADTBase val adtFormat: Format[ADTBase] = { implicit lazy val v1: Format[X] = Json.format implicit lazy val v2: Format[Y] = Json.format implicit lazy val v3: Format[Z] = Json.format implicit lazy val v4: Format[ADTBase] = flat.oformat((__ \ "type").format[String]) v4 } println(Json.parse("""{"type":"Z","l":{"type":"X","a":1},"r":{"type":"Y","b":"VVV"}}""").as[ADTBase](adtFormat))
Link to Scastie: https://scastie.scala-lang.org/WIYG5my6TNyIYF8zsWIkCg
The text was updated successfully, but these errors were encountered:
Writes
Format
@ncreep would you be interested in having a look?
Sorry, something went wrong.
Recursion my old friend...
Will take a look.
Opened a pull request with the fix: #85.
Successfully merging a pull request may close this issue.
Here is a code snippet that works fine using 9.0.0 but fails with stack overflow using 10.0.1:
Link to Scastie: https://scastie.scala-lang.org/WIYG5my6TNyIYF8zsWIkCg
The text was updated successfully, but these errors were encountered: