Skip to content
New issue

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

JsonObjectWriter without value. #57

Open
optician opened this issue Sep 11, 2019 · 0 comments
Open

JsonObjectWriter without value. #57

optician opened this issue Sep 11, 2019 · 0 comments

Comments

@optician
Copy link
Contributor

case class Wrapper(i: Int)

implicit val wrapperWriter: JsonWriter[Wrapper] = new JsonObjectWriter[Wrapper] {
  override def writeValues(value: Wrapper, tokenWriter: TokenWriter): Unit = {
    tokenWriter.writeFieldName(classOf[Wrapper].getName)
//    tokenWriter.writeNumber(value.i)
  }
}

Wrapper(42).asJson

results with {"Wrapper"}. Error is expected because it's not a json object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant