8000 Enum singleton cases should be optionally serialized to string. · Issue #2033 · circe/circe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Enum singleton cases should be optionally serialized to string. #2033
Open
@liewhite

Description

@liewhite
enum E {
  case E1
  case E2
}

val e: E = E.E1
println(e.asJson) // expect "E1"  json string here, but current is {"E1":{}} 

In most situations, serializing singleton cases to empty object is meaningless. Actually, we want a string const here.

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