4
import io.circe.generic.extras.{Configuration, ConfiguredJsonCodec}
@ConfiguredJsonCodec case class Foo(firstName: String)
object Foo {
implicit val snakeConfiguration=Configuration.default.withSnakeCaseMemberNames}

after parsing

{"first_name":"Bob"}

we get

Foo("Bob")

If we add to Foo additional empty constructor

@ConfiguredJsonCodec case class Foo(firstName: String) {
def this() = this("")
}
object Foo {implicit val
 snakeConfiguration=Configuration.default.withSnakeCaseMemberNames}

we will get

could not find Lazy implicit value of type io.circe.generic.extras.decoding.ConfiguredDecoder[Foo]

Please, help me to fix that error

  • 2
    This looks like it may be a bug (whether in circe or Shapeless I can't tell yet). Is there a reason you don't want to use a default argument for `firstName` instead of overloading the constructor? – Travis Brown Mar 19 '19 at 17:03
  • 2
    Thanks for your opinion. I don't want to use a default argument for firstName because these classes are used for jaxb and jaxb needs no-arg constructor in some cases – Сергей Залесский Mar 20 '19 at 09:05
  • 1
    For the record, this is a Shapeless bug, but we might eventually work around it in circe: https://github.com/circe/circe/issues/1129#issuecomment-494358743 – Travis Brown May 21 '19 at 11:53

0 Answers0