2

With lift-json backed json4s, if I do the following:

val foobar = ("foo" -> JNothing) ~ ("bar" -> 42) 
println(write(foobar))

The output is:

{, "bar":42}

which is not valid JSON. I would like to obtain:

{"foo":null, "bar":42}

Is there any way to serialize JNothing into null?

Eduardo
  • 8,362
  • 6
  • 38
  • 72

1 Answers1

2

I have found that, if I replace JNothing for JNull, I get the results that I expect.

Eduardo
  • 8,362
  • 6
  • 38
  • 72