@@ -62,11 +62,7 @@ internal class TDOQueryItem : NSObject {
6262 self . stringValue = Self . getStringValue ( by: rawValue)
6363 }
6464
65- private class func getStringValue( by rawValue: Any , isCollectionValuesSupported: Bool = true ) -> String ? {
66- if !isCollectionValuesSupported,
67- ( rawValue is Array < Any > || rawValue is Dictionary < AnyHashable , Any > ) {
68- return nil
69- }
65+ private class func getStringValue( by rawValue: Any ) -> String ? {
7066 var formattedValue : String ?
7167 switch rawValue {
7268 case let losslessString as CustomStringConvertible :
@@ -86,17 +82,15 @@ internal class TDOQueryItem : NSObject {
8682 return formattedValue
8783 }
8884
89- class func getItems( from dictionary: [ AnyHashable : Any ] ? , isCollectionValuesSupported : Bool = true ) -> [ TDOQueryItem ] ? {
85+ class func getItems( from dictionary: [ AnyHashable : Any ] ? ) -> [ TDOQueryItem ] ? {
9086 guard let dic = dictionary else { return nil }
9187 var queryItems = [ TDOQueryItem] ( )
9288
9389 for (key, value) in dic {
9490 guard let key = key as? String else { continue }
95- if Self . getStringValue ( by: value, isCollectionValuesSupported: isCollectionValuesSupported) == nil {
96- if isCollectionValuesSupported {
97- /// `value` is not a valid type - skipping
98- assertionFailure ( " TDOAuth: failed to casting the parameter: \( value) for the key: \( key) " )
99- }
91+ if Self . getStringValue ( by: value) == nil {
92+ /// `value` is not a valid type - skipping
93+ assertionFailure ( " TDOAuth: failed to casting the parameter: \( value) for the key: \( key) " )
10094 continue
10195 }
10296 let queryItem = TDOQueryItem ( name: key, rawValue: value)
@@ -279,7 +273,7 @@ internal class TDOQueryItem : NSObject {
279273 signatureMethod: TDOAuthSignatureMethod ) -> URLRequest ! {
280274
281275 return self . urlRequest ( forPath: unencodedPathWithoutQuery,
282- queryItems: TDOQueryItem . getItems ( from: unencodedParameters, isCollectionValuesSupported : method == " POST " ) ?? [ ] ,
276+ queryItems: TDOQueryItem . getItems ( from: unencodedParameters) ?? [ ] ,
283277 host: host,
284278 consumerKey: consumerKey,
285279 consumerSecret: consumerSecret,
0 commit comments