Skip to content

Commit

Permalink
update kotlin docs alibaba#294
Browse files Browse the repository at this point in the history
  • Loading branch information
kraity committed May 21, 2022
1 parent c475c6d commit f8e78f2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/kotlin_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,17 @@ val data = url.into<List<User>>()
val input = ... // InputStream
val data = input.into<List<User>>()
```

# 3. 进阶使用

### 3.1 使用`JSONPath`

#### 3.1.1 使用`JSONPath`读取部分数据

```kotlin
val text = "..."
val path = "$.id".toPath() // JSONPath

val parser = JSONReader.of(text)
val result = path.extract(parser)
```
14 changes: 14 additions & 0 deletions docs/kotlin_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,17 @@ val data = url.into<List<User>>()
val input = ... // InputStream
val data = input.into<List<User>>()
```

# 3. Advanced usage

### 3.1 Use `JSONPath`

#### 3.1.1 Use `JSONPath` to read specified data

```kotlin
val text = "..."
val path = "$.id".toPath() // JSONPath

val parser = JSONReader.of(text)
val result = path.extract(parser)
```

0 comments on commit f8e78f2

Please sign in to comment.