8000 [generic extras] Default value of Option is ignored · Issue #878 · circe/circe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[generic extras] Default value of Option is ignored #878
Closed
@ryamaguchi0220

Description

@ryamaguchi0220

Hi, The following code returns Right(Foo(a, None)) 
but, I expect Right(Foo(a, Some(0)))

Is this a bug, or am I doing something wrong?

import io.circe.generic.extras.auto._
import io.circe.generic.extras.Configuration

implicit val customConfig: Configuration = Configuration.default.withDefaults

case class Foo(a: String = "a", b: Option[Int] = Some(0))
io.circe.parser.decode[Foo]("{}")

My dependencies.

"io.circe" %% "circe-core" % "0.9.3"
"io.circe" %% "circe-generic" % "0.9.3"
"io.circe" %% "circe-parser" % "0.9.3"
"io.circe" %% "circe-generic-extras" % "0.9.3"

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0