Need to convert NaN in Json(as it is not JSON) to Double in Json4s without using jackson.
For example, I am having following JSON:
{ "a": NaN }
I need to parse above json using JSON4S.
Can we write any deserializer if possible for this?
Need to convert NaN in Json(as it is not JSON) to Double in Json4s without using jackson.
For example, I am having following JSON:
{ "a": NaN }
I need to parse above json using JSON4S.
Can we write any deserializer if possible for this?
You can achieve this from the version 3.6.7
:
import org.json4s._
import org.json4s.native.JsonMethods._
def main(args: Array[String]): Unit = {
val json = """{"a": "NaN"}"""
println(parse(json))
// Displays
// JObject(List((a,JString(NaN))))
}