Skip to content

Commit

Permalink
upd doc
Browse files Browse the repository at this point in the history
  • Loading branch information
junyulah committed Sep 12, 2018
1 parent b9c201a commit 8a7b4c5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@ object Main {
JSON.stringify(List(1,2,3))

// {"items": [1,2,3], "type": "testl"}
JSON.stringify(Map("items" -> List(1,2,3), "type" -> "test"))
JSON.stringify(Map("items" -> List(1,2,3), "type" -> "test"))

// {"name": "NoName", age: 7}
JSON.stringify(User("NoName", 7))
JSON.stringify(User("NoName", 7))

/* parse to plain scala object */
// List(1,2,3)
JSON.parse("[1,2,3]")
JSON.parse("[1,2,3]")

// Map("a" -> 1, "b" -> 2)
JSON.parse(s"""{"a":1,"b":2}""")
JSON.parse(s"""{"a":1,"b":2}""")

// parse to target type
// User("ddchen", 10)
JSON.parseTo[User](s"""{"name":"ddchen","age":10}""")
JSON.parseTo[User](s"""{"name":"ddchen","age":10}""")
}
}
```
Expand Down

0 comments on commit 8a7b4c5

Please sign in to comment.