mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 19:33:55 +00:00
Add once-removed Array extension method
This commit is contained in:
parent
bb3ec04ed1
commit
dbfc46658f
@ -8,10 +8,6 @@ import Alamofire
|
|||||||
import PromiseKit
|
import PromiseKit
|
||||||
import SwiftyJSON
|
import SwiftyJSON
|
||||||
|
|
||||||
extension Request {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
extension Bool: JSONEncodable {
|
extension Bool: JSONEncodable {
|
||||||
func encode() -> AnyObject { return self }
|
func encode() -> AnyObject { return self }
|
||||||
}
|
}
|
||||||
@ -32,6 +28,16 @@ extension String: JSONEncodable {
|
|||||||
func encode() -> AnyObject { return self }
|
func encode() -> AnyObject { return self }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension Array: JSONEncodable {
|
||||||
|
func encode() -> AnyObject {
|
||||||
|
if Element.self is JSONEncodable {
|
||||||
|
return self.map { ($0 as! JSONEncodable).encode() }
|
||||||
|
} else {
|
||||||
|
return self.map { ($0 as! AnyObject) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
extension JSON {
|
extension JSON {
|
||||||
func decode() -> Bool? {
|
func decode() -> Bool? {
|
||||||
return self.bool
|
return self.bool
|
||||||
|
Loading…
Reference in New Issue
Block a user