We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4066966 commit 113de73Copy full SHA for 113de73
README.md
@@ -98,6 +98,16 @@ struct CustomAdapter: JSONAdapter {
98
decoder.valueNotFoundDecodingStrategy = .custom(CustomAdapter())
99
```
100
101
+可以通过 `JSONStringDecodingStrategy` 将 JSON 格式的字符串自动转成 `Codable` 对象或数组
102
+
103
+```swift
104
+// 包含这些 key 的 JSON 字符串转成对象
105
+decoder.jsonStringDecodingStrategy = .containsKeys([])
106
107
+// 所有 JSON 字符串都转成对象
108
+decoder.jsonStringDecodingStrategy = .all
109
+```
110
111
### For Moya
112
113
使用 `Moya.Response` 自带的 [map](https://github.com/Moya/Moya/blob/master/Sources/Moya/Response.swift) 方法解析,传入 `CleanJSONDecoder`
0 commit comments