[2.0] diverging implicit expansion for type play.api.libs.json.Writes[java.lang.String]

936 views
Skip to first unread message

Manuel Bernhardt

unread,
Aug 29, 2012, 10:32:09 AM8/29/12
to play-fr...@googlegroups.com
Hi,

every time I attempt to use the built-in JSON library of Play, I get
bitten by the message above, get upset and use jerkson or whatever
else. Then I forget and some months try again...

So this time I'm writing a mail instead.

Does anyone have an idea what is going wrong?

https://gist.github.com/3513352

Thanks,

Manuel

Will Sargent

unread,
Aug 29, 2012, 3:56:49 PM8/29/12
to play-fr...@googlegroups.com
Take out the toJson calls, and use JsString.

Will.
> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>

Manuel Bernhardt

unread,
Aug 29, 2012, 6:16:21 PM8/29/12
to play-fr...@googlegroups.com
Hi Will,

is there an implicit conversion I should have in scope then in order
to turn the Map into a JsValue? I tried to use toJson on the top-level
Map, but that's still leading to the same error
(https://gist.github.com/3513352). Without the toJson I get the wrong
type.

Thanks,

Manuel

Sadache Aldrobi

unread,
Aug 29, 2012, 6:20:42 PM8/29/12
to play-fr...@googlegroups.com
This issue is solved on master, you have a nicer Json constructor.
For prior versions, you can not transform a Map[String,Any] into JSON, you need to transform each field, or have a homogenous non Any Map.
www.sadekdrobi.com
ʎdoɹʇuǝ

Manuel Bernhardt

unread,
Aug 30, 2012, 7:52:44 AM8/30/12
to play-fr...@googlegroups.com
Thanks, building everything by hand via JsObject-s, JsArray-s etc is
cumbersome but works.
Reply all
Reply to author
Forward
0 new messages