Skip to content

Commit 11ae73d

Browse files
committed
Not to wrap a JSON dictionary to an array, but directly map it to object then wrap
1 parent cca2233 commit 11ae73d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ObjectMapper/Core/Mapper.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ public final class Mapper<N: Mappable> {
136136
// failed to parse JSON into array form
137137
// try to parse it into a dictionary and then wrap it in an array
138138
if let JSONDict = parseJSONDictionary(parsedJSON) {
139-
return mapArray([JSONDict])
139+
let object = map(JSONDict)
140+
return [object]
140141
}
141142

142143
return []

0 commit comments

Comments
 (0)