mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 10:58:55 +00:00
Merge pull request #6106 from davidpasztor/fix_issue5878
[Swift3] Fixed compilation issue on macOS
This commit is contained in:
commit
f1b5ad2e0f
@ -125,10 +125,10 @@ class Decoders {
|
||||
|
||||
static func decode<T>(clazz: T.Type, source: AnyObject, instance: AnyObject?) -> Decoded<T> {
|
||||
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)
|
||||
}
|
||||
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)
|
||||
}
|
||||
if let intermediate = source as? String, let value = UUID(uuidString: intermediate) as? T, source is String, T.self is UUID.Type {
|
||||
|
@ -125,10 +125,10 @@ class Decoders {
|
||||
|
||||
static func decode<T>(clazz: T.Type, source: AnyObject, instance: AnyObject?) -> Decoded<T> {
|
||||
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)
|
||||
}
|
||||
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)
|
||||
}
|
||||
if let intermediate = source as? String, let value = UUID(uuidString: intermediate) as? T, source is String, T.self is UUID.Type {
|
||||
|
@ -125,10 +125,10 @@ class Decoders {
|
||||
|
||||
static func decode<T>(clazz: T.Type, source: AnyObject, instance: AnyObject?) -> Decoded<T> {
|
||||
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)
|
||||
}
|
||||
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)
|
||||
}
|
||||
if let intermediate = source as? String, let value = UUID(uuidString: intermediate) as? T, source is String, T.self is UUID.Type {
|
||||
|
@ -125,10 +125,10 @@ class Decoders {
|
||||
|
||||
static func decode<T>(clazz: T.Type, source: AnyObject, instance: AnyObject?) -> Decoded<T> {
|
||||
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)
|
||||
}
|
||||
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)
|
||||
}
|
||||
if let intermediate = source as? String, let value = UUID(uuidString: intermediate) as? T, source is String, T.self is UUID.Type {
|
||||
|
@ -125,10 +125,10 @@ class Decoders {
|
||||
|
||||
static func decode<T>(clazz: T.Type, source: AnyObject, instance: AnyObject?) -> Decoded<T> {
|
||||
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)
|
||||
}
|
||||
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)
|
||||
}
|
||||
if let intermediate = source as? String, let value = UUID(uuidString: intermediate) as? T, source is String, T.self is UUID.Type {
|
||||
|
Loading…
Reference in New Issue
Block a user