Skip to content

Commit

Permalink
Fix nested object serialization with generics
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Oct 21, 2024
1 parent a810403 commit bd8ee83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions templates/apple/Sources/Client.swift.twig
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,7 @@ open class Client {
|| param is [Bool: Any] {
encodedParams[key] = param
} else {
let value = try! (param as! Encodable).toJson()

let range = value.index(value.startIndex, offsetBy: 1)..<value.index(value.endIndex, offsetBy: -1)
let substring = value[range]

encodedParams[key] = substring
encodedParams[key] = try (param as! Encodable).toJson()
}
}

Expand Down
7 changes: 1 addition & 6 deletions templates/swift/Sources/Client.swift.twig
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,7 @@ open class Client {
|| param is [Bool: Any] {
encodedParams[key] = param
} else {
let value = try! (param as! Encodable).toJson()

let range = value.index(value.startIndex, offsetBy: 1)..<value.index(value.endIndex, offsetBy: -1)
let substring = value[range]

encodedParams[key] = substring
encodedParams[key] = try (param as! Encodable).toJson()
}
}

Expand Down

0 comments on commit bd8ee83

Please sign in to comment.