Open amnaredo opened 3 years ago
There'd need to be this Reader in upickle implicits (or you might add it yourself to your app) :
implicit def MapR[V: R] = R[Map[String, V]](
Internal.validate("Obj(Array(n))"){
case Js.Obj(arr@_*) => arr.map { case (k,v) => (k, readJs[V](v))}.toMap
}
)
I'm not sure what has changed but I have the same problem... This generic MapR :
implicit def MapR[K: R, V: R] = R[Map[K, V]](
Internal.validate("Array(n)"){case x: Js.Arr => x.value.map(readJs[(K, V)]).toMap}
)
fails, because x
is Js.Obj
instead of Js.Arr
@lihaoyi do you think the Reader has its place in upickle implicits? Or is it more complicated than that ?
Original Author: l15k4
thank you ,its working now .
Original Author: chandu0101
It's more complicated than that. Let's close this in favor of https://github.com/lihaoyi/upickle/issues/39
Original Author: lihaoyi
Hi , I am trying to convert json string to Map
it failing with message
ID: 46 Original Author: chandu0101