I have the following code:
def test = Action {
val Anon = new {
val foo = "foo"
val bar = "bar"
}
Ok(Json.toJson(Anon))
}
And I get this compilation error:
No Json deserializer found for type Object{val foo: String; val bar: String}. Try to implement an implicit Writes or Format for this type.
What is the quick fix for this problem? I already found another question here that relates to this error, but perhaps it was more specific/complex.