Skip to content

Commit f6ac4d1

Browse files
committed
[Update] Improve support for RawRepresentable parameters
1 parent 9aade90 commit f6ac4d1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Sources/Core/Wrapper/APIParameterConvertible.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ extension Dictionary: APIParameterConvertible where Key == String {
4545
if let value = $0 as? AnyAPIParameter { return value }
4646
if let value = $0 as? (any APIParameter) { return .init(value) }
4747
if let value = $0 as? APIParameterConvertible { return value.toParameters }
48+
49+
if let value = $0 as? (any RawRepresentable) {
50+
return mapAnyObjectToEncodable(value.rawValue as AnyObject)
51+
}
4852
return mapAnyObjectToEncodable($0 as AnyObject)
4953
}
5054

0 commit comments

Comments
 (0)