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
The problem can be reproduced with the test below (it should also be added to CirceFormatNoFlatTests along with the fix)
CirceFormatNoFlatTests
object KebsProtocol extends KebsCirce with KebsCirce.NoFlat import KebsProtocol._ case class R(a: Int, rs: Seq[R]) test("Recursive format") { val decoder = implicitly[Decoder[R]] val encoder = implicitly[Encoder[R]] decoder.apply( Json .fromFields(Seq("a" -> Json.fromInt(1), "rs" -> Json.arr(Json.fromFields(Seq("a" -> Json.fromInt(2), "rs" -> Json.arr()))))) .hcursor) shouldBe Right(R(1, Seq(R(2, Seq.empty[R])))) encoder.apply(R(1, Seq(R(2, Seq.empty[R])))) shouldBe Json.fromFields( Seq("a" -> Json.fromInt(1), "rs" -> Json.arr(Json.fromFields(Seq("a" -> Json.fromInt(2), "rs" -> Json.arr()))))) }
Workaround: Add codecs using circe's semi-auto derivation. Example:
trait JsonProtocol extends FailFastCirceSupport with KebsCirce with KebsCirce.NoFlat with KebsEnumFormats with TimeInstances with UtilInstances with NetInstances { implicit val decoder: Decoder[Thing] = deriveDecoder[Thing] implicit val encoder: Encoder[Thing] = deriveEncoder[Thing] }
The text was updated successfully, but these errors were encountered:
NoFlat will be no longer present in kebs 2.0.
Sorry, something went wrong.
No branches or pull requests
The problem can be reproduced with the test below (it should also be added to
CirceFormatNoFlatTests
along with the fix)Workaround: Add codecs using circe's semi-auto derivation. Example:
The text was updated successfully, but these errors were encountered: