forked from loafle/openapi-generator-original
Update APIHelper.mustache
This commit is contained in:
@@ -19,16 +19,18 @@ class APIHelper {
|
||||
return destination
|
||||
}
|
||||
|
||||
static func convertBoolToString(source: [String: AnyObject]) -> [String:AnyObject] {
|
||||
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
|
||||
if (source != nil) {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user