shell script ran under /bin/swift3-petstore.sh

This commit is contained in:
David Pasztor 2017-07-18 17:20:42 +01:00
parent a3871d1f33
commit fa555cf452

View File

@ -125,10 +125,10 @@ class Decoders {
static func decode<T>(clazz: T.Type, source: AnyObject, instance: AnyObject?) -> Decoded<T> { static func decode<T>(clazz: T.Type, source: AnyObject, instance: AnyObject?) -> Decoded<T> {
initialize() initialize()
if let value = source.int32Value as? T, source is NSNumber, T.self is Int32.Type { if let sourceNumber = source as? NSNumber, let value = sourceNumber.int32Value as? T, T.self is Int32.Type {
return .success(value) return .success(value)
} }
if let value = source.int32Value as? T, source is NSNumber, T.self is Int64.Type { if let sourceNumber = source as? NSNumber, let value = sourceNumber.int32Value as? T, T.self is Int64.Type {
return .success(value) return .success(value)
} }
if let intermediate = source as? String, let value = UUID(uuidString: intermediate) as? T, source is String, T.self is UUID.Type { if let intermediate = source as? String, let value = UUID(uuidString: intermediate) as? T, source is String, T.self is UUID.Type {