Skip to content

Commit 737fa9e

Browse files
algolia-botFluf22
andcommitted
fix(swift): accept any type during json encoding (generated)
algolia/api-clients-automation#3576 Co-authored-by: Thomas Raffray <[email protected]>
1 parent 37ac0e7 commit 737fa9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Core/Helpers/Extensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ extension Data: JSONEncodable {
9191

9292
let jsonData = "{\"data\":\(selfString)}".data(using: .utf8)
9393
guard let jsonData,
94-
let json = try? CodableHelper.jsonDecoder.decode([String: String].self, from: jsonData) else {
94+
let json = try? CodableHelper.jsonDecoder.decode([String: AnyCodable].self, from: jsonData) else {
9595
fatalError("Could not decode from data holder: `{\"data\":\(selfString)}`")
9696
}
9797

0 commit comments

Comments
 (0)