Last active
May 6, 2020 18:20
-
-
Save Pavneet-Sing/c14142876f619918cd957f04ab723e47 to your computer and use it in GitHub Desktop.
Parse a JSON response to Person data class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val dataJSONStr = """ | |
{ | |
"name": "Pavneet", | |
"occupation": "Software Engineer" | |
} | |
""".trimIndent() | |
val mapper = ObjectMapper() | |
println(mapper.readValue(dataJSONStr, Person::class.java)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment