mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 19:33:55 +00:00
returning non nil potentially void dictionary
This commit is contained in:
parent
09a0222308
commit
4b39e0579f
@ -18,4 +18,20 @@ class APIHelper {
|
||||
}
|
||||
return destination
|
||||
}
|
||||
|
||||
static func convertBoolToString(source: [String: AnyObject]) -> [String:AnyObject] {
|
||||
var destination = [String:AnyObject]()
|
||||
let theTrue = NSNumber(bool: true)
|
||||
let theFalse = NSNumber(bool: false)
|
||||
for (key, value) in source {
|
||||
switch value {
|
||||
case let x where x === theTrue || x === theFalse:
|
||||
destination[key] = "\(value as! Bool)"
|
||||
default:
|
||||
destination[key] = value
|
||||
}
|
||||
}
|
||||
return destination
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user