forked from loafle/openapi-generator-original
shell script ran under /bin/swift3-petstore.sh
This commit is contained in:
parent
a3871d1f33
commit
fa555cf452
@ -125,12 +125,12 @@ 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 {
|
||||||
return .success(value)
|
return .success(value)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user