0

I am working in Scala programming language.

I want to convert json object to Map[String, String]

My jsonObject looks like

{"Key1":"Val1","Key2":"Val2","Key3":"Val3"}

I want to have a Map like

Map("Key1" -> "Val1", "Key2" -> "Val2", "Key3" -> "Val3")

How can i do this? Note: I am using Gson for my other json manipulation

Thanks

4

1 Answer 1

2

You can use Jackson object Mapper for this.

https://www.alexkras.com/parse-json-object-to-map-in-scala-using-jackson/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.