Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 lift-json 支持的 json4s,如果我执行以下操作:
val foobar = ("foo" -> JNothing) ~ ("bar" -> 42) println(write(foobar))
输出是:
{, "bar":42}
这不是有效的 JSON。我想获得:
{"foo":null, "bar":42}
有什么办法可以序列JNothing化成null?
JNothing
null
我发现,如果我替换JNothingfor JNull,我会得到我期望的结果。
JNull