-
Notifications
You must be signed in to change notification settings - Fork 190
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
Error : spray.json.SerializationException: Map key must be formatted as JsString, not '["A","b"]' #217
Comments
Tuple2 is encoded as JSON array. And JSON array could not be an JSON object key. |
For me this workaround doesn't work :
But JsonReader implicit is not resolved for |
That would work:
|
And you should probably change reads, to get rid of asInstanceOf, and fail with |
Yeah I did not want to discourage people from reading it as they usually give up on snippets longer that xx lines and I would decrease my changes on getting help :-) |
import spray.json._ val list = Map("k"->"f","n"->"r","d"->ListInt) compiler error: Cannot find JsonWriter or JsonFormat type class for scala.collection.immutable.Map[String,java.io.Serializable] I used wrong? |
@chenshaoxing you crossposted at #292, I answered there. |
Hi, I defined an object as follow :
case class Obj(a: String, b: Map[String, List[String]], c: String, d : Int, f : Map[(String,String), (Float,Float)])
All the config for spray worked until I add
Map[(String,String), (Float,Float)]
println(Obj("id", Map( "Rule1" -> List("el1","el2")), "srcRep", 1, Map( (("A","b")) -> ((0.5f,1.2f)) ) ).toJson)
Here's the stacktrace :
The text was updated successfully, but these errors were encountered: