Skip to content

Commit 4e903a8

Browse files
committed
update samples
1 parent dbf0733 commit 4e903a8

10 files changed

Lines changed: 30 additions & 30 deletions

File tree

samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public struct APIHelper {
2222

2323
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
2424
return source.reduce(into: [String: String]()) { (result, item) in
25-
if let collection = item.value as? Array<Any?> {
25+
if let collection = item.value as? [Any?] {
2626
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
2727
} else if let value: Any = item.value {
2828
result[item.key] = "\(value)"
@@ -46,15 +46,15 @@ public struct APIHelper {
4646
}
4747

4848
public static func mapValueToPathItem(_ source: Any) -> Any {
49-
if let collection = source as? Array<Any?> {
49+
if let collection = source as? [Any?] {
5050
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5151
}
5252
return source
5353
}
5454

5555
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
5656
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
57-
if let collection = item.value as? Array<Any?> {
57+
if let collection = item.value as? [Any?] {
5858
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5959
result.append(URLQueryItem(name: item.key, value: value))
6060
} else if let value = item.value {

samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public struct APIHelper {
2222

2323
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
2424
return source.reduce(into: [String: String]()) { (result, item) in
25-
if let collection = item.value as? Array<Any?> {
25+
if let collection = item.value as? [Any?] {
2626
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
2727
} else if let value: Any = item.value {
2828
result[item.key] = "\(value)"
@@ -46,15 +46,15 @@ public struct APIHelper {
4646
}
4747

4848
public static func mapValueToPathItem(_ source: Any) -> Any {
49-
if let collection = source as? Array<Any?> {
49+
if let collection = source as? [Any?] {
5050
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5151
}
5252
return source
5353
}
5454

5555
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
5656
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
57-
if let collection = item.value as? Array<Any?> {
57+
if let collection = item.value as? [Any?] {
5858
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5959
result.append(URLQueryItem(name: item.key, value: value))
6060
} else if let value = item.value {

samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public struct APIHelper {
2222

2323
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
2424
return source.reduce(into: [String: String]()) { (result, item) in
25-
if let collection = item.value as? Array<Any?> {
25+
if let collection = item.value as? [Any?] {
2626
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
2727
} else if let value: Any = item.value {
2828
result[item.key] = "\(value)"
@@ -46,15 +46,15 @@ public struct APIHelper {
4646
}
4747

4848
public static func mapValueToPathItem(_ source: Any) -> Any {
49-
if let collection = source as? Array<Any?> {
49+
if let collection = source as? [Any?] {
5050
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5151
}
5252
return source
5353
}
5454

5555
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
5656
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
57-
if let collection = item.value as? Array<Any?> {
57+
if let collection = item.value as? [Any?] {
5858
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5959
result.append(URLQueryItem(name: item.key, value: value))
6060
} else if let value = item.value {

samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal struct APIHelper {
2222

2323
internal static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
2424
return source.reduce(into: [String: String]()) { (result, item) in
25-
if let collection = item.value as? Array<Any?> {
25+
if let collection = item.value as? [Any?] {
2626
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
2727
} else if let value: Any = item.value {
2828
result[item.key] = "\(value)"
@@ -46,15 +46,15 @@ internal struct APIHelper {
4646
}
4747

4848
internal static func mapValueToPathItem(_ source: Any) -> Any {
49-
if let collection = source as? Array<Any?> {
49+
if let collection = source as? [Any?] {
5050
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5151
}
5252
return source
5353
}
5454

5555
internal static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
5656
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
57-
if let collection = item.value as? Array<Any?> {
57+
if let collection = item.value as? [Any?] {
5858
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5959
result.append(URLQueryItem(name: item.key, value: value))
6060
} else if let value = item.value {

samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public struct APIHelper {
2222

2323
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
2424
return source.reduce(into: [String: String]()) { (result, item) in
25-
if let collection = item.value as? Array<Any?> {
25+
if let collection = item.value as? [Any?] {
2626
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
2727
} else if let value: Any = item.value {
2828
result[item.key] = "\(value)"
@@ -46,15 +46,15 @@ public struct APIHelper {
4646
}
4747

4848
public static func mapValueToPathItem(_ source: Any) -> Any {
49-
if let collection = source as? Array<Any?> {
49+
if let collection = source as? [Any?] {
5050
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5151
}
5252
return source
5353
}
5454

5555
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
5656
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
57-
if let collection = item.value as? Array<Any?> {
57+
if let collection = item.value as? [Any?] {
5858
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5959
result.append(URLQueryItem(name: item.key, value: value))
6060
} else if let value = item.value {

samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public struct APIHelper {
2222

2323
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
2424
return source.reduce(into: [String: String]()) { (result, item) in
25-
if let collection = item.value as? Array<Any?> {
25+
if let collection = item.value as? [Any?] {
2626
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
2727
} else if let value: Any = item.value {
2828
result[item.key] = "\(value)"
@@ -46,15 +46,15 @@ public struct APIHelper {
4646
}
4747

4848
public static func mapValueToPathItem(_ source: Any) -> Any {
49-
if let collection = source as? Array<Any?> {
49+
if let collection = source as? [Any?] {
5050
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5151
}
5252
return source
5353
}
5454

5555
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
5656
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
57-
if let collection = item.value as? Array<Any?> {
57+
if let collection = item.value as? [Any?] {
5858
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5959
result.append(URLQueryItem(name: item.key, value: value))
6060
} else if let value = item.value {

samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public struct APIHelper {
2222

2323
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
2424
return source.reduce(into: [String: String]()) { (result, item) in
25-
if let collection = item.value as? Array<Any?> {
25+
if let collection = item.value as? [Any?] {
2626
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
2727
} else if let value: Any = item.value {
2828
result[item.key] = "\(value)"
@@ -46,15 +46,15 @@ public struct APIHelper {
4646
}
4747

4848
public static func mapValueToPathItem(_ source: Any) -> Any {
49-
if let collection = source as? Array<Any?> {
49+
if let collection = source as? [Any?] {
5050
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5151
}
5252
return source
5353
}
5454

5555
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
5656
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
57-
if let collection = item.value as? Array<Any?> {
57+
if let collection = item.value as? [Any?] {
5858
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5959
result.append(URLQueryItem(name: item.key, value: value))
6060
} else if let value = item.value {

samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public struct APIHelper {
2222

2323
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
2424
return source.reduce(into: [String: String]()) { (result, item) in
25-
if let collection = item.value as? Array<Any?> {
25+
if let collection = item.value as? [Any?] {
2626
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
2727
} else if let value: Any = item.value {
2828
result[item.key] = "\(value)"
@@ -46,15 +46,15 @@ public struct APIHelper {
4646
}
4747

4848
public static func mapValueToPathItem(_ source: Any) -> Any {
49-
if let collection = source as? Array<Any?> {
49+
if let collection = source as? [Any?] {
5050
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5151
}
5252
return source
5353
}
5454

5555
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
5656
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
57-
if let collection = item.value as? Array<Any?> {
57+
if let collection = item.value as? [Any?] {
5858
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5959
result.append(URLQueryItem(name: item.key, value: value))
6060
} else if let value = item.value {

samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public struct APIHelper {
2222

2323
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
2424
return source.reduce(into: [String: String]()) { (result, item) in
25-
if let collection = item.value as? Array<Any?> {
25+
if let collection = item.value as? [Any?] {
2626
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
2727
} else if let value: Any = item.value {
2828
result[item.key] = "\(value)"
@@ -46,15 +46,15 @@ public struct APIHelper {
4646
}
4747

4848
public static func mapValueToPathItem(_ source: Any) -> Any {
49-
if let collection = source as? Array<Any?> {
49+
if let collection = source as? [Any?] {
5050
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5151
}
5252
return source
5353
}
5454

5555
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
5656
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
57-
if let collection = item.value as? Array<Any?> {
57+
if let collection = item.value as? [Any?] {
5858
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5959
result.append(URLQueryItem(name: item.key, value: value))
6060
} else if let value = item.value {

samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIHelper.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public struct APIHelper {
2222

2323
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
2424
return source.reduce(into: [String: String]()) { (result, item) in
25-
if let collection = item.value as? Array<Any?> {
25+
if let collection = item.value as? [Any?] {
2626
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
2727
} else if let value: Any = item.value {
2828
result[item.key] = "\(value)"
@@ -46,15 +46,15 @@ public struct APIHelper {
4646
}
4747

4848
public static func mapValueToPathItem(_ source: Any) -> Any {
49-
if let collection = source as? Array<Any?> {
49+
if let collection = source as? [Any?] {
5050
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5151
}
5252
return source
5353
}
5454

5555
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
5656
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
57-
if let collection = item.value as? Array<Any?> {
57+
if let collection = item.value as? [Any?] {
5858
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
5959
result.append(URLQueryItem(name: item.key, value: value))
6060
} else if let value = item.value {

0 commit comments

Comments
 (0)