1

Sorry for asking stupid question. I just have lack of experience with Json. So, I have JsObject like:

{"field1":"value1", "field2":"value2", "field3":"value3"}

Can I somehow convert this to Map[String,String] ?

asked Mar 19, 2014 at 12:29

1 Answer 1

1

Like this:

import play.api.libs.json.Json
val json = Json.parse("""{"field1":"value1", "field2":"value2", "field3":"value3"}""")
val map = json.as[Map[String, String]]
answered Mar 19, 2014 at 12:31
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.