forked from loafle/openapi-generator-original
[Swift4]Update templates for swift 4 (#6921)
* update versions of dependencies on swift4 and swift3 * change syntax for swift4 * run petstore script * change enum case from UpperCamel to lowerCamel * remove unneeded break statements * avoid wrapping conditionals in parentheses * avoid force casting * run pod update on petstore/swift4/rxswift * update project for swift 4 * run swift4-petstore-all.sh * fix compile error * avoid use iso8601 date strategy for encoder / decoder * resolve file references
This commit is contained in:
parent
b06ccec11e
commit
a5e4abe5ec
1
.java-version
Normal file
1
.java-version
Normal file
@ -0,0 +1 @@
|
||||
oracle64-1.8.0.152
|
@ -88,7 +88,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
}
|
||||
self.processRequest(uploadRequest, managerId, completion)
|
||||
case .Failure(let encodingError):
|
||||
completion(response: nil, error: ErrorResponse.Error(415, nil, encodingError))
|
||||
completion(response: nil, error: ErrorResponse.error(415, nil, encodingError))
|
||||
}
|
||||
}
|
||||
)
|
||||
@ -121,7 +121,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
if stringResponse.result.isFailure {
|
||||
completion(
|
||||
response: nil,
|
||||
error: ErrorResponse.Error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!)
|
||||
error: ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -141,7 +141,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
if voidResponse.result.isFailure {
|
||||
completion(
|
||||
response: nil,
|
||||
error: ErrorResponse.Error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
error: ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -158,10 +158,10 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
validatedRequest.responseData(completionHandler: { (dataResponse) in
|
||||
cleanupRequest()
|
||||
|
||||
if (dataResponse.result.isFailure) {
|
||||
if dataResponse.result.isFailure {
|
||||
completion(
|
||||
response: nil,
|
||||
error: ErrorResponse.Error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
error: ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -179,7 +179,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
cleanupRequest()
|
||||
|
||||
if response.result.isFailure {
|
||||
completion(response: nil, error: ErrorResponse.Error(response.response?.statusCode ?? 500, response.data, response.result.error!))
|
||||
completion(response: nil, error: ErrorResponse.error(response.response?.statusCode ?? 500, response.data, response.result.error!))
|
||||
return
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
return
|
||||
}
|
||||
|
||||
completion(response: nil, error: ErrorResponse.Error(500, nil, NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"])))
|
||||
completion(response: nil, error: ErrorResponse.error(500, nil, NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"])))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,8 +28,8 @@ public class Response<T> {
|
||||
public convenience init(response: NSHTTPURLResponse, body: T?) {
|
||||
let rawHeader = response.allHeaderFields
|
||||
var header = [String:String]()
|
||||
for (key, value) in rawHeader {
|
||||
header[key as! String] = value as? String
|
||||
for case let (key, value) as (String, String) in rawHeader {
|
||||
header[key] = value
|
||||
}
|
||||
self.init(statusCode: response.statusCode, header: header, body: body)
|
||||
}
|
||||
|
@ -118,16 +118,12 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
else {
|
||||
mpForm.append(fileURL, withName: k)
|
||||
}
|
||||
break
|
||||
case let string as String:
|
||||
mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k)
|
||||
break
|
||||
case let number as NSNumber:
|
||||
mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k)
|
||||
break
|
||||
default:
|
||||
fatalError("Unprocessable value \(v) with key \(k)")
|
||||
break
|
||||
}
|
||||
}
|
||||
}, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in
|
||||
@ -206,7 +202,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
validatedRequest.responseData(completionHandler: { (dataResponse) in
|
||||
cleanupRequest()
|
||||
|
||||
if (dataResponse.result.isFailure) {
|
||||
if dataResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.HttpError(statusCode: dataResponse.response?.statusCode ?? 500, data: dataResponse.data, error: dataResponse.result.error!)
|
||||
|
@ -1,3 +1,3 @@
|
||||
github "Alamofire/Alamofire" >= 3.1.0{{#usePromiseKit}}
|
||||
github "mxcl/PromiseKit" >=1.5.3{{/usePromiseKit}}{{#useRxSwift}}
|
||||
github "ReactiveX/RxSwift" ~> 2.0{{/useRxSwift}}
|
||||
github "Alamofire/Alamofire" ~> 4.5{{#usePromiseKit}}
|
||||
github "mxcl/PromiseKit" ~> 4.4{{/usePromiseKit}}{{#useRxSwift}}
|
||||
github "ReactiveX/RxSwift" "rxswift-3.0"{{/useRxSwift}}
|
@ -54,7 +54,7 @@ extension Dictionary: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
var dictionary = [AnyHashable: Any]()
|
||||
for (key, value) in self {
|
||||
dictionary[key as! NSObject] = encodeIfPossible(value)
|
||||
dictionary[key] = encodeIfPossible(value)
|
||||
}
|
||||
return dictionary as Any
|
||||
}
|
||||
|
@ -29,8 +29,8 @@ open class Response<T> {
|
||||
public convenience init(response: HTTPURLResponse, body: T?) {
|
||||
let rawHeader = response.allHeaderFields
|
||||
var header = [String:String]()
|
||||
for (key, value) in rawHeader {
|
||||
header[key as! String] = value as? String
|
||||
for case let (key, value) as (String, String) in rawHeader {
|
||||
header[key] = value
|
||||
}
|
||||
self.init(statusCode: response.statusCode, header: header, body: body)
|
||||
}
|
||||
|
@ -16,6 +16,6 @@ Pod::Spec.new do |s|
|
||||
s.documentation_url = '{{podDocumentationURL}}'{{/podDocumentationURL}}
|
||||
s.source_files = '{{projectName}}/Classes/**/*.swift'{{#usePromiseKit}}
|
||||
s.dependency 'PromiseKit/CorePromise', '~> 4.4.0'{{/usePromiseKit}}{{#useRxSwift}}
|
||||
s.dependency 'RxSwift', '~> 3.4.1'{{/useRxSwift}}
|
||||
s.dependency 'RxSwift', '3.6.1'{{/useRxSwift}}
|
||||
s.dependency 'Alamofire', '~> 4.5.0'
|
||||
end
|
||||
|
@ -77,16 +77,12 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
else {
|
||||
mpForm.append(fileURL, withName: k)
|
||||
}
|
||||
break
|
||||
case let string as String:
|
||||
mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k)
|
||||
break
|
||||
case let number as NSNumber:
|
||||
mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k)
|
||||
break
|
||||
default:
|
||||
fatalError("Unprocessable value \(v) with key \(k)")
|
||||
break
|
||||
}
|
||||
}
|
||||
}, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in
|
||||
@ -97,7 +93,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
}
|
||||
self.processRequest(request: upload, managerId, completion)
|
||||
case .failure(let encodingError):
|
||||
completion(nil, ErrorResponse.Error(415, nil, encodingError))
|
||||
completion(nil, ErrorResponse.error(415, nil, encodingError))
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@ -129,7 +125,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
if stringResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.Error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!)
|
||||
ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -186,9 +182,9 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
)
|
||||
|
||||
} catch let requestParserError as DownloadException {
|
||||
completion(nil, ErrorResponse.Error(400, dataResponse.data, requestParserError))
|
||||
completion(nil, ErrorResponse.error(400, dataResponse.data, requestParserError))
|
||||
} catch let error {
|
||||
completion(nil, ErrorResponse.Error(400, dataResponse.data, error))
|
||||
completion(nil, ErrorResponse.error(400, dataResponse.data, error))
|
||||
}
|
||||
return
|
||||
})
|
||||
@ -199,7 +195,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
if voidResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.Error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -215,10 +211,10 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
validatedRequest.responseData(completionHandler: { (dataResponse) in
|
||||
cleanupRequest()
|
||||
|
||||
if (dataResponse.result.isFailure) {
|
||||
if dataResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.Error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -331,7 +327,7 @@ open class AlamofireDecodableRequestBuilder<T:Decodable>: AlamofireRequestBuilde
|
||||
if stringResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.Error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!)
|
||||
ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -351,7 +347,7 @@ open class AlamofireDecodableRequestBuilder<T:Decodable>: AlamofireRequestBuilde
|
||||
if voidResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.Error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -367,10 +363,10 @@ open class AlamofireDecodableRequestBuilder<T:Decodable>: AlamofireRequestBuilde
|
||||
validatedRequest.responseData(completionHandler: { (dataResponse) in
|
||||
cleanupRequest()
|
||||
|
||||
if (dataResponse.result.isFailure) {
|
||||
if dataResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.Error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -388,17 +384,17 @@ open class AlamofireDecodableRequestBuilder<T:Decodable>: AlamofireRequestBuilde
|
||||
cleanupRequest()
|
||||
|
||||
guard dataResponse.result.isSuccess else {
|
||||
completion(nil, ErrorResponse.Error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!))
|
||||
completion(nil, ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!))
|
||||
return
|
||||
}
|
||||
|
||||
guard let data = dataResponse.data, !data.isEmpty else {
|
||||
completion(nil, ErrorResponse.Error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse))
|
||||
completion(nil, ErrorResponse.error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse))
|
||||
return
|
||||
}
|
||||
|
||||
guard let httpResponse = dataResponse.response else {
|
||||
completion(nil, ErrorResponse.Error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse))
|
||||
completion(nil, ErrorResponse.error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse))
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
github "Alamofire/Alamofire" >= 3.1.0{{#usePromiseKit}}
|
||||
github "mxcl/PromiseKit" >=1.5.3{{/usePromiseKit}}{{#useRxSwift}}
|
||||
github "ReactiveX/RxSwift" ~> 2.0{{/useRxSwift}}
|
||||
github "Alamofire/Alamofire" ~> 4.5.0{{#usePromiseKit}}
|
||||
github "mxcl/PromiseKit" ~> 4.4{{/usePromiseKit}}{{#useRxSwift}}
|
||||
github "ReactiveX/RxSwift" ~> 4.0{{/useRxSwift}}
|
||||
|
@ -22,9 +22,12 @@ open class CodableHelper {
|
||||
decoder.dateDecodingStrategy = .formatted(df)
|
||||
} else {
|
||||
decoder.dataDecodingStrategy = .base64
|
||||
if #available(iOS 10.0, *) {
|
||||
decoder.dateDecodingStrategy = .iso8601
|
||||
}
|
||||
let formatter = DateFormatter()
|
||||
formatter.calendar = Calendar(identifier: .iso8601)
|
||||
formatter.locale = Locale(identifier: "en_US_POSIX")
|
||||
formatter.timeZone = TimeZone(secondsFromGMT: 0)
|
||||
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX"
|
||||
decoder.dateDecodingStrategy = .formatted(formatter)
|
||||
}
|
||||
|
||||
do {
|
||||
@ -45,9 +48,12 @@ open class CodableHelper {
|
||||
encoder.outputFormatting = .prettyPrinted
|
||||
}
|
||||
encoder.dataEncodingStrategy = .base64
|
||||
if #available(iOS 10.0, *) {
|
||||
encoder.dateEncodingStrategy = .iso8601
|
||||
}
|
||||
let formatter = DateFormatter()
|
||||
formatter.calendar = Calendar(identifier: .iso8601)
|
||||
formatter.locale = Locale(identifier: "en_US_POSIX")
|
||||
formatter.timeZone = TimeZone(secondsFromGMT: 0)
|
||||
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX"
|
||||
encoder.dateEncodingStrategy = .formatted(formatter)
|
||||
|
||||
do {
|
||||
returnedData = try encoder.encode(value)
|
||||
|
@ -54,7 +54,7 @@ extension Dictionary: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
var dictionary = [AnyHashable: Any]()
|
||||
for (key, value) in self {
|
||||
dictionary[key as! NSObject] = encodeIfPossible(value)
|
||||
dictionary[key] = encodeIfPossible(value)
|
||||
}
|
||||
return dictionary as Any
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ protocol JSONEncodable {
|
||||
}
|
||||
|
||||
public enum ErrorResponse : Error {
|
||||
case Error(Int, Data?, Error)
|
||||
case error(Int, Data?, Error)
|
||||
}
|
||||
|
||||
open class Response<T> {
|
||||
@ -28,8 +28,8 @@ open class Response<T> {
|
||||
public convenience init(response: HTTPURLResponse, body: T?) {
|
||||
let rawHeader = response.allHeaderFields
|
||||
var header = [String:String]()
|
||||
for (key, value) in rawHeader {
|
||||
header[key as! String] = value as? String
|
||||
for case let (key, value) as (String, String) in rawHeader {
|
||||
header[key] = value
|
||||
}
|
||||
self.init(statusCode: response.statusCode, header: header, body: body)
|
||||
}
|
||||
|
@ -16,6 +16,6 @@ Pod::Spec.new do |s|
|
||||
s.documentation_url = '{{podDocumentationURL}}'{{/podDocumentationURL}}
|
||||
s.source_files = '{{projectName}}/Classes/**/*.swift'{{#usePromiseKit}}
|
||||
s.dependency 'PromiseKit/CorePromise', '~> 4.4.0'{{/usePromiseKit}}{{#useRxSwift}}
|
||||
s.dependency 'RxSwift', '~> 3.4.1'{{/useRxSwift}}
|
||||
s.dependency 'RxSwift', '~> 4.0'{{/useRxSwift}}
|
||||
s.dependency 'Alamofire', '~> 4.5.0'
|
||||
end
|
||||
|
@ -74,9 +74,9 @@ open class {{classname}} {
|
||||
return Observable.create { observer -> Disposable in
|
||||
{{operationId}}({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { {{#returnType}}data, {{/returnType}}error in
|
||||
if let error = error {
|
||||
observer.on(.error(error as Error))
|
||||
observer.on(.error(error))
|
||||
} else {
|
||||
observer.on(.next({{#returnType}}data!{{/returnType}}))
|
||||
observer.on(.next({{#returnType}}data!{{/returnType}}{{^returnType}}(){{/returnType}}))
|
||||
}
|
||||
observer.on(.completed)
|
||||
}
|
||||
|
@ -64,13 +64,13 @@ open class {{classname}}: {{#parent}}{{{parent}}}{{/parent}}{{^parent}}Codable{{
|
||||
}
|
||||
{{/additionalPropertiesType}}
|
||||
|
||||
{{#hasVars}}
|
||||
{{^parent}}{{#hasVars}}
|
||||
public init({{#vars}}{{name}}: {{{datatypeWithEnum}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/vars}}) {
|
||||
{{#vars}}
|
||||
self.{{name}} = {{name}}
|
||||
{{/vars}}
|
||||
}
|
||||
{{/hasVars}}
|
||||
{{/hasVars}}{{/parent}}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
@ -79,7 +79,7 @@ open class {{classname}}: {{#parent}}{{{parent}}}{{/parent}}{{^parent}}Codable{{
|
||||
var container = encoder.container(keyedBy: String.self)
|
||||
|
||||
{{#vars}}
|
||||
try container.encode{{#isListContainer}}Array{{/isListContainer}}{{^required}}IfPresent{{/required}}({{{name}}}, forKey: "{{{baseName}}}")
|
||||
try container.encode{{^required}}IfPresent{{/required}}({{{name}}}, forKey: "{{{baseName}}}")
|
||||
{{/vars}}
|
||||
{{#additionalPropertiesType}}
|
||||
try container.encodeMap(additionalProperties)
|
||||
@ -88,11 +88,11 @@ open class {{classname}}: {{#parent}}{{{parent}}}{{/parent}}{{^parent}}Codable{{
|
||||
|
||||
// Decodable protocol methods
|
||||
|
||||
public {{#parent}}override {{/parent}}required init(from decoder: Decoder) throws {
|
||||
public required init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: String.self)
|
||||
|
||||
{{#vars}}
|
||||
{{name}} = try container.decode{{#isListContainer}}Array{{/isListContainer}}{{^required}}IfPresent{{/required}}({{#isListContainer}}{{{items.datatype}}}{{/isListContainer}}{{^isListContainer}}{{{datatypeWithEnum}}}{{/isListContainer}}.self, forKey: "{{{baseName}}}")
|
||||
{{name}} = try container.decode{{^required}}IfPresent{{/required}}({{{datatypeWithEnum}}}.self, forKey: "{{{baseName}}}")
|
||||
{{/vars}}
|
||||
{{#additionalPropertiesType}}
|
||||
var nonAdditionalPropertyKeys = Set<String>()
|
||||
@ -101,6 +101,9 @@ open class {{classname}}: {{#parent}}{{{parent}}}{{/parent}}{{^parent}}Codable{{
|
||||
{{/vars}}
|
||||
additionalProperties = try container.decodeMap({{{additionalPropertiesType}}}.self, excludedKeys: nonAdditionalPropertyKeys)
|
||||
{{/additionalPropertiesType}}
|
||||
{{#parent}}
|
||||
try super.init(from: decoder)
|
||||
{{/parent}}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,16 +66,12 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
switch v {
|
||||
case let fileURL as NSURL:
|
||||
mpForm.appendBodyPart(fileURL: fileURL, name: k)
|
||||
break
|
||||
case let string as NSString:
|
||||
mpForm.appendBodyPart(data: string.dataUsingEncoding(NSUTF8StringEncoding)!, name: k)
|
||||
break
|
||||
case let number as NSNumber:
|
||||
mpForm.appendBodyPart(data: number.stringValue.dataUsingEncoding(NSUTF8StringEncoding)!, name: k)
|
||||
break
|
||||
default:
|
||||
fatalError("Unprocessable value \(v) with key \(k)")
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -88,7 +84,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
}
|
||||
self.processRequest(uploadRequest, managerId, completion)
|
||||
case .Failure(let encodingError):
|
||||
completion(response: nil, error: ErrorResponse.Error(415, nil, encodingError))
|
||||
completion(response: nil, error: ErrorResponse.error(415, nil, encodingError))
|
||||
}
|
||||
}
|
||||
)
|
||||
@ -121,7 +117,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
if stringResponse.result.isFailure {
|
||||
completion(
|
||||
response: nil,
|
||||
error: ErrorResponse.Error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!)
|
||||
error: ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -141,7 +137,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
if voidResponse.result.isFailure {
|
||||
completion(
|
||||
response: nil,
|
||||
error: ErrorResponse.Error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
error: ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -158,10 +154,10 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
validatedRequest.responseData(completionHandler: { (dataResponse) in
|
||||
cleanupRequest()
|
||||
|
||||
if (dataResponse.result.isFailure) {
|
||||
if dataResponse.result.isFailure {
|
||||
completion(
|
||||
response: nil,
|
||||
error: ErrorResponse.Error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
error: ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -179,7 +175,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
cleanupRequest()
|
||||
|
||||
if response.result.isFailure {
|
||||
completion(response: nil, error: ErrorResponse.Error(response.response?.statusCode ?? 500, response.data, response.result.error!))
|
||||
completion(response: nil, error: ErrorResponse.error(response.response?.statusCode ?? 500, response.data, response.result.error!))
|
||||
return
|
||||
}
|
||||
|
||||
@ -198,7 +194,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
return
|
||||
}
|
||||
|
||||
completion(response: nil, error: ErrorResponse.Error(500, nil, NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"])))
|
||||
completion(response: nil, error: ErrorResponse.error(500, nil, NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"])))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,8 +28,8 @@ public class Response<T> {
|
||||
public convenience init(response: NSHTTPURLResponse, body: T?) {
|
||||
let rawHeader = response.allHeaderFields
|
||||
var header = [String:String]()
|
||||
for (key, value) in rawHeader {
|
||||
header[key as! String] = value as? String
|
||||
for case let (key, value) as (String, String) in rawHeader {
|
||||
header[key] = value
|
||||
}
|
||||
self.init(statusCode: response.statusCode, header: header, body: body)
|
||||
}
|
||||
|
@ -66,16 +66,12 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
switch v {
|
||||
case let fileURL as NSURL:
|
||||
mpForm.appendBodyPart(fileURL: fileURL, name: k)
|
||||
break
|
||||
case let string as NSString:
|
||||
mpForm.appendBodyPart(data: string.dataUsingEncoding(NSUTF8StringEncoding)!, name: k)
|
||||
break
|
||||
case let number as NSNumber:
|
||||
mpForm.appendBodyPart(data: number.stringValue.dataUsingEncoding(NSUTF8StringEncoding)!, name: k)
|
||||
break
|
||||
default:
|
||||
fatalError("Unprocessable value \(v) with key \(k)")
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -88,7 +84,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
}
|
||||
self.processRequest(uploadRequest, managerId, completion)
|
||||
case .Failure(let encodingError):
|
||||
completion(response: nil, error: ErrorResponse.Error(415, nil, encodingError))
|
||||
completion(response: nil, error: ErrorResponse.error(415, nil, encodingError))
|
||||
}
|
||||
}
|
||||
)
|
||||
@ -121,7 +117,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
if stringResponse.result.isFailure {
|
||||
completion(
|
||||
response: nil,
|
||||
error: ErrorResponse.Error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!)
|
||||
error: ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -141,7 +137,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
if voidResponse.result.isFailure {
|
||||
completion(
|
||||
response: nil,
|
||||
error: ErrorResponse.Error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
error: ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -158,10 +154,10 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
validatedRequest.responseData(completionHandler: { (dataResponse) in
|
||||
cleanupRequest()
|
||||
|
||||
if (dataResponse.result.isFailure) {
|
||||
if dataResponse.result.isFailure {
|
||||
completion(
|
||||
response: nil,
|
||||
error: ErrorResponse.Error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
error: ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -179,7 +175,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
cleanupRequest()
|
||||
|
||||
if response.result.isFailure {
|
||||
completion(response: nil, error: ErrorResponse.Error(response.response?.statusCode ?? 500, response.data, response.result.error!))
|
||||
completion(response: nil, error: ErrorResponse.error(response.response?.statusCode ?? 500, response.data, response.result.error!))
|
||||
return
|
||||
}
|
||||
|
||||
@ -198,7 +194,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
return
|
||||
}
|
||||
|
||||
completion(response: nil, error: ErrorResponse.Error(500, nil, NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"])))
|
||||
completion(response: nil, error: ErrorResponse.error(500, nil, NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"])))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,8 +28,8 @@ public class Response<T> {
|
||||
public convenience init(response: NSHTTPURLResponse, body: T?) {
|
||||
let rawHeader = response.allHeaderFields
|
||||
var header = [String:String]()
|
||||
for (key, value) in rawHeader {
|
||||
header[key as! String] = value as? String
|
||||
for case let (key, value) as (String, String) in rawHeader {
|
||||
header[key] = value
|
||||
}
|
||||
self.init(statusCode: response.statusCode, header: header, body: body)
|
||||
}
|
||||
|
@ -66,16 +66,12 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
switch v {
|
||||
case let fileURL as NSURL:
|
||||
mpForm.appendBodyPart(fileURL: fileURL, name: k)
|
||||
break
|
||||
case let string as NSString:
|
||||
mpForm.appendBodyPart(data: string.dataUsingEncoding(NSUTF8StringEncoding)!, name: k)
|
||||
break
|
||||
case let number as NSNumber:
|
||||
mpForm.appendBodyPart(data: number.stringValue.dataUsingEncoding(NSUTF8StringEncoding)!, name: k)
|
||||
break
|
||||
default:
|
||||
fatalError("Unprocessable value \(v) with key \(k)")
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -88,7 +84,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
}
|
||||
self.processRequest(uploadRequest, managerId, completion)
|
||||
case .Failure(let encodingError):
|
||||
completion(response: nil, error: ErrorResponse.Error(415, nil, encodingError))
|
||||
completion(response: nil, error: ErrorResponse.error(415, nil, encodingError))
|
||||
}
|
||||
}
|
||||
)
|
||||
@ -121,7 +117,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
if stringResponse.result.isFailure {
|
||||
completion(
|
||||
response: nil,
|
||||
error: ErrorResponse.Error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!)
|
||||
error: ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -141,7 +137,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
if voidResponse.result.isFailure {
|
||||
completion(
|
||||
response: nil,
|
||||
error: ErrorResponse.Error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
error: ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -158,10 +154,10 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
validatedRequest.responseData(completionHandler: { (dataResponse) in
|
||||
cleanupRequest()
|
||||
|
||||
if (dataResponse.result.isFailure) {
|
||||
if dataResponse.result.isFailure {
|
||||
completion(
|
||||
response: nil,
|
||||
error: ErrorResponse.Error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
error: ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -179,7 +175,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
cleanupRequest()
|
||||
|
||||
if response.result.isFailure {
|
||||
completion(response: nil, error: ErrorResponse.Error(response.response?.statusCode ?? 500, response.data, response.result.error!))
|
||||
completion(response: nil, error: ErrorResponse.error(response.response?.statusCode ?? 500, response.data, response.result.error!))
|
||||
return
|
||||
}
|
||||
|
||||
@ -198,7 +194,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
return
|
||||
}
|
||||
|
||||
completion(response: nil, error: ErrorResponse.Error(500, nil, NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"])))
|
||||
completion(response: nil, error: ErrorResponse.error(500, nil, NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"])))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,8 +28,8 @@ public class Response<T> {
|
||||
public convenience init(response: NSHTTPURLResponse, body: T?) {
|
||||
let rawHeader = response.allHeaderFields
|
||||
var header = [String:String]()
|
||||
for (key, value) in rawHeader {
|
||||
header[key as! String] = value as? String
|
||||
for case let (key, value) as (String, String) in rawHeader {
|
||||
header[key] = value
|
||||
}
|
||||
self.init(statusCode: response.statusCode, header: header, body: body)
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
}
|
||||
self.processRequest(uploadRequest, managerId, completion)
|
||||
case .Failure(let encodingError):
|
||||
completion(response: nil, error: ErrorResponse.Error(415, nil, encodingError))
|
||||
completion(response: nil, error: ErrorResponse.error(415, nil, encodingError))
|
||||
}
|
||||
}
|
||||
)
|
||||
@ -121,7 +121,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
if stringResponse.result.isFailure {
|
||||
completion(
|
||||
response: nil,
|
||||
error: ErrorResponse.Error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!)
|
||||
error: ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -141,7 +141,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
if voidResponse.result.isFailure {
|
||||
completion(
|
||||
response: nil,
|
||||
error: ErrorResponse.Error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
error: ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -158,10 +158,10 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
validatedRequest.responseData(completionHandler: { (dataResponse) in
|
||||
cleanupRequest()
|
||||
|
||||
if (dataResponse.result.isFailure) {
|
||||
if dataResponse.result.isFailure {
|
||||
completion(
|
||||
response: nil,
|
||||
error: ErrorResponse.Error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
error: ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -179,7 +179,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
cleanupRequest()
|
||||
|
||||
if response.result.isFailure {
|
||||
completion(response: nil, error: ErrorResponse.Error(response.response?.statusCode ?? 500, response.data, response.result.error!))
|
||||
completion(response: nil, error: ErrorResponse.error(response.response?.statusCode ?? 500, response.data, response.result.error!))
|
||||
return
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
return
|
||||
}
|
||||
|
||||
completion(response: nil, error: ErrorResponse.Error(500, nil, NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"])))
|
||||
completion(response: nil, error: ErrorResponse.error(500, nil, NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"])))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,8 +28,8 @@ public class Response<T> {
|
||||
public convenience init(response: NSHTTPURLResponse, body: T?) {
|
||||
let rawHeader = response.allHeaderFields
|
||||
var header = [String:String]()
|
||||
for (key, value) in rawHeader {
|
||||
header[key as! String] = value as? String
|
||||
for case let (key, value) as (String, String) in rawHeader {
|
||||
header[key] = value
|
||||
}
|
||||
self.init(statusCode: response.statusCode, header: header, body: body)
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
github "Alamofire/Alamofire" >= 3.1.0
|
||||
github "Alamofire/Alamofire" ~> 4.5
|
@ -1,5 +1,5 @@
|
||||
//
|
||||
// AnotherfakeAPI.swift
|
||||
// AnotherFakeAPI.swift
|
||||
//
|
||||
// Generated by swagger-codegen
|
||||
// https://github.com/swagger-api/swagger-codegen
|
||||
@ -9,7 +9,7 @@ import Foundation
|
||||
import Alamofire
|
||||
|
||||
|
||||
open class AnotherfakeAPI: APIBase {
|
||||
open class AnotherFakeAPI: APIBase {
|
||||
/**
|
||||
To test special tags
|
||||
- parameter body: (body) client model
|
||||
|
@ -381,6 +381,38 @@ open class FakeAPI: APIBase {
|
||||
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
test inline additionalProperties
|
||||
- parameter param: (body) request body
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testInlineAdditionalProperties(param: Any, completion: @escaping ((_ error: ErrorResponse?) -> Void)) {
|
||||
testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in
|
||||
completion(error)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
test inline additionalProperties
|
||||
- POST /fake/inline-additionalProperties
|
||||
-
|
||||
|
||||
- parameter param: (body) request body
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testInlineAdditionalPropertiesWithRequestBuilder(param: Any) -> RequestBuilder<Void> {
|
||||
let path = "/fake/inline-additionalProperties"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = param.encodeToJSON()
|
||||
|
||||
let url = NSURLComponents(string: URLString)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true)
|
||||
}
|
||||
|
||||
/**
|
||||
test json serialization of form data
|
||||
- parameter param: (form) field1
|
||||
|
@ -118,16 +118,12 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
else {
|
||||
mpForm.append(fileURL, withName: k)
|
||||
}
|
||||
break
|
||||
case let string as String:
|
||||
mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k)
|
||||
break
|
||||
case let number as NSNumber:
|
||||
mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k)
|
||||
break
|
||||
default:
|
||||
fatalError("Unprocessable value \(v) with key \(k)")
|
||||
break
|
||||
}
|
||||
}
|
||||
}, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in
|
||||
@ -206,7 +202,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
validatedRequest.responseData(completionHandler: { (dataResponse) in
|
||||
cleanupRequest()
|
||||
|
||||
if (dataResponse.result.isFailure) {
|
||||
if dataResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.HttpError(statusCode: dataResponse.response?.statusCode ?? 500, data: dataResponse.data, error: dataResponse.result.error!)
|
||||
|
@ -53,7 +53,7 @@ extension Dictionary: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
var dictionary = [AnyHashable: Any]()
|
||||
for (key, value) in self {
|
||||
dictionary[key as! NSObject] = encodeIfPossible(value)
|
||||
dictionary[key] = encodeIfPossible(value)
|
||||
}
|
||||
return dictionary as Any
|
||||
}
|
||||
|
@ -29,8 +29,8 @@ open class Response<T> {
|
||||
public convenience init(response: HTTPURLResponse, body: T?) {
|
||||
let rawHeader = response.allHeaderFields
|
||||
var header = [String:String]()
|
||||
for (key, value) in rawHeader {
|
||||
header[key as! String] = value as? String
|
||||
for case let (key, value) as (String, String) in rawHeader {
|
||||
header[key] = value
|
||||
}
|
||||
self.init(statusCode: response.statusCode, header: header, body: body)
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
github "Alamofire/Alamofire" >= 3.1.0
|
||||
github "Alamofire/Alamofire" ~> 4.5
|
@ -1,5 +1,5 @@
|
||||
//
|
||||
// AnotherfakeAPI.swift
|
||||
// AnotherFakeAPI.swift
|
||||
//
|
||||
// Generated by swagger-codegen
|
||||
// https://github.com/swagger-api/swagger-codegen
|
||||
@ -9,7 +9,7 @@ import Foundation
|
||||
import Alamofire
|
||||
|
||||
|
||||
open class AnotherfakeAPI: APIBase {
|
||||
open class AnotherFakeAPI: APIBase {
|
||||
/**
|
||||
To test special tags
|
||||
- parameter body: (body) client model
|
||||
|
@ -381,6 +381,38 @@ open class FakeAPI: APIBase {
|
||||
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
test inline additionalProperties
|
||||
- parameter param: (body) request body
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testInlineAdditionalProperties(param: Any, completion: @escaping ((_ error: ErrorResponse?) -> Void)) {
|
||||
testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in
|
||||
completion(error)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
test inline additionalProperties
|
||||
- POST /fake/inline-additionalProperties
|
||||
-
|
||||
|
||||
- parameter param: (body) request body
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testInlineAdditionalPropertiesWithRequestBuilder(param: Any) -> RequestBuilder<Void> {
|
||||
let path = "/fake/inline-additionalProperties"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = param.encodeToJSON()
|
||||
|
||||
let url = NSURLComponents(string: URLString)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true)
|
||||
}
|
||||
|
||||
/**
|
||||
test json serialization of form data
|
||||
- parameter param: (form) field1
|
||||
|
@ -1,5 +1,5 @@
|
||||
//
|
||||
// Fake_classname_tags123API.swift
|
||||
// FakeClassnameTags123API.swift
|
||||
//
|
||||
// Generated by swagger-codegen
|
||||
// https://github.com/swagger-api/swagger-codegen
|
||||
@ -9,17 +9,15 @@ import Foundation
|
||||
import Alamofire
|
||||
|
||||
|
||||
|
||||
open class Fake_classname_tags123API {
|
||||
open class FakeClassnameTags123API: APIBase {
|
||||
/**
|
||||
To test class name in snake case
|
||||
|
||||
- parameter body: (body) client model
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testClassname(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) {
|
||||
open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) {
|
||||
testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in
|
||||
completion(response?.body, error);
|
||||
completion(response?.body, error)
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,19 +31,16 @@ open class Fake_classname_tags123API {
|
||||
- examples: [{contentType=application/json, example={
|
||||
"client" : "client"
|
||||
}}]
|
||||
|
||||
- parameter body: (body) client model
|
||||
|
||||
- returns: RequestBuilder<Client>
|
||||
*/
|
||||
open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder<Client> {
|
||||
let path = "/fake_classname_test"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
let parameters = body.encodeToJSON()
|
||||
|
||||
let url = NSURLComponents(string: URLString)
|
||||
|
||||
|
||||
let requestBuilder: RequestBuilder<Client>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true)
|
@ -118,16 +118,12 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
else {
|
||||
mpForm.append(fileURL, withName: k)
|
||||
}
|
||||
break
|
||||
case let string as String:
|
||||
mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k)
|
||||
break
|
||||
case let number as NSNumber:
|
||||
mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k)
|
||||
break
|
||||
default:
|
||||
fatalError("Unprocessable value \(v) with key \(k)")
|
||||
break
|
||||
}
|
||||
}
|
||||
}, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in
|
||||
@ -206,7 +202,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
validatedRequest.responseData(completionHandler: { (dataResponse) in
|
||||
cleanupRequest()
|
||||
|
||||
if (dataResponse.result.isFailure) {
|
||||
if dataResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.HttpError(statusCode: dataResponse.response?.statusCode ?? 500, data: dataResponse.data, error: dataResponse.result.error!)
|
||||
|
@ -53,7 +53,7 @@ extension Dictionary: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
var dictionary = [AnyHashable: Any]()
|
||||
for (key, value) in self {
|
||||
dictionary[key as! NSObject] = encodeIfPossible(value)
|
||||
dictionary[key] = encodeIfPossible(value)
|
||||
}
|
||||
return dictionary as Any
|
||||
}
|
||||
|
@ -29,8 +29,8 @@ open class Response<T> {
|
||||
public convenience init(response: HTTPURLResponse, body: T?) {
|
||||
let rawHeader = response.allHeaderFields
|
||||
var header = [String:String]()
|
||||
for (key, value) in rawHeader {
|
||||
header[key as! String] = value as? String
|
||||
for case let (key, value) as (String, String) in rawHeader {
|
||||
header[key] = value
|
||||
}
|
||||
self.init(statusCode: response.statusCode, header: header, body: body)
|
||||
}
|
||||
|
@ -29,11 +29,6 @@ open class FormatTest: JSONEncodable {
|
||||
}
|
||||
}
|
||||
public var number: Double?
|
||||
public var numberNum: NSNumber? {
|
||||
get {
|
||||
return number.map({ return NSNumber(value: $0) })
|
||||
}
|
||||
}
|
||||
public var float: Float?
|
||||
public var floatNum: NSNumber? {
|
||||
get {
|
||||
|
@ -11,11 +11,6 @@ import Foundation
|
||||
open class NumberOnly: JSONEncodable {
|
||||
|
||||
public var justNumber: Double?
|
||||
public var justNumberNum: NSNumber? {
|
||||
get {
|
||||
return justNumber.map({ return NSNumber(value: $0) })
|
||||
}
|
||||
}
|
||||
|
||||
public init() {}
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
github "Alamofire/Alamofire" >= 3.1.0
|
||||
github "mxcl/PromiseKit" >=1.5.3
|
||||
github "Alamofire/Alamofire" ~> 4.5
|
||||
github "mxcl/PromiseKit" ~> 4.4
|
@ -1,5 +1,5 @@
|
||||
//
|
||||
// AnotherfakeAPI.swift
|
||||
// AnotherFakeAPI.swift
|
||||
//
|
||||
// Generated by swagger-codegen
|
||||
// https://github.com/swagger-api/swagger-codegen
|
||||
@ -10,7 +10,7 @@ import Alamofire
|
||||
import PromiseKit
|
||||
|
||||
|
||||
open class AnotherfakeAPI: APIBase {
|
||||
open class AnotherFakeAPI: APIBase {
|
||||
/**
|
||||
To test special tags
|
||||
- parameter body: (body) client model
|
||||
|
@ -510,6 +510,54 @@ open class FakeAPI: APIBase {
|
||||
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
test inline additionalProperties
|
||||
- parameter param: (body) request body
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testInlineAdditionalProperties(param: Any, completion: @escaping ((_ error: ErrorResponse?) -> Void)) {
|
||||
testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in
|
||||
completion(error)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
test inline additionalProperties
|
||||
- parameter param: (body) request body
|
||||
- returns: Promise<Void>
|
||||
*/
|
||||
open class func testInlineAdditionalProperties( param: Any) -> Promise<Void> {
|
||||
let deferred = Promise<Void>.pending()
|
||||
testInlineAdditionalProperties(param: param) { error in
|
||||
if let error = error {
|
||||
deferred.reject(error)
|
||||
} else {
|
||||
deferred.fulfill()
|
||||
}
|
||||
}
|
||||
return deferred.promise
|
||||
}
|
||||
|
||||
/**
|
||||
test inline additionalProperties
|
||||
- POST /fake/inline-additionalProperties
|
||||
-
|
||||
|
||||
- parameter param: (body) request body
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testInlineAdditionalPropertiesWithRequestBuilder(param: Any) -> RequestBuilder<Void> {
|
||||
let path = "/fake/inline-additionalProperties"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = param.encodeToJSON()
|
||||
|
||||
let url = NSURLComponents(string: URLString)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true)
|
||||
}
|
||||
|
||||
/**
|
||||
test json serialization of form data
|
||||
- parameter param: (form) field1
|
||||
|
@ -118,16 +118,12 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
else {
|
||||
mpForm.append(fileURL, withName: k)
|
||||
}
|
||||
break
|
||||
case let string as String:
|
||||
mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k)
|
||||
break
|
||||
case let number as NSNumber:
|
||||
mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k)
|
||||
break
|
||||
default:
|
||||
fatalError("Unprocessable value \(v) with key \(k)")
|
||||
break
|
||||
}
|
||||
}
|
||||
}, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in
|
||||
@ -206,7 +202,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
validatedRequest.responseData(completionHandler: { (dataResponse) in
|
||||
cleanupRequest()
|
||||
|
||||
if (dataResponse.result.isFailure) {
|
||||
if dataResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.HttpError(statusCode: dataResponse.response?.statusCode ?? 500, data: dataResponse.data, error: dataResponse.result.error!)
|
||||
|
@ -54,7 +54,7 @@ extension Dictionary: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
var dictionary = [AnyHashable: Any]()
|
||||
for (key, value) in self {
|
||||
dictionary[key as! NSObject] = encodeIfPossible(value)
|
||||
dictionary[key] = encodeIfPossible(value)
|
||||
}
|
||||
return dictionary as Any
|
||||
}
|
||||
|
@ -29,8 +29,8 @@ open class Response<T> {
|
||||
public convenience init(response: HTTPURLResponse, body: T?) {
|
||||
let rawHeader = response.allHeaderFields
|
||||
var header = [String:String]()
|
||||
for (key, value) in rawHeader {
|
||||
header[key as! String] = value as? String
|
||||
for case let (key, value) as (String, String) in rawHeader {
|
||||
header[key] = value
|
||||
}
|
||||
self.init(statusCode: response.statusCode, header: header, body: body)
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
github "Alamofire/Alamofire" >= 3.1.0
|
||||
github "ReactiveX/RxSwift" ~> 2.0
|
||||
github "Alamofire/Alamofire" ~> 4.5
|
||||
github "ReactiveX/RxSwift" "rxswift-3.0"
|
@ -9,6 +9,6 @@ Pod::Spec.new do |s|
|
||||
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
||||
s.summary = 'PetstoreClient'
|
||||
s.source_files = 'PetstoreClient/Classes/**/*.swift'
|
||||
s.dependency 'RxSwift', '~> 3.4.1'
|
||||
s.dependency 'RxSwift', '3.6.1'
|
||||
s.dependency 'Alamofire', '~> 4.5.0'
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
//
|
||||
// AnotherfakeAPI.swift
|
||||
// AnotherFakeAPI.swift
|
||||
//
|
||||
// Generated by swagger-codegen
|
||||
// https://github.com/swagger-api/swagger-codegen
|
||||
@ -10,7 +10,7 @@ import Alamofire
|
||||
import RxSwift
|
||||
|
||||
|
||||
open class AnotherfakeAPI: APIBase {
|
||||
open class AnotherFakeAPI: APIBase {
|
||||
/**
|
||||
To test special tags
|
||||
- parameter body: (body) client model
|
||||
|
@ -524,6 +524,56 @@ open class FakeAPI: APIBase {
|
||||
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
test inline additionalProperties
|
||||
- parameter param: (body) request body
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testInlineAdditionalProperties(param: Any, completion: @escaping ((_ error: ErrorResponse?) -> Void)) {
|
||||
testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in
|
||||
completion(error)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
test inline additionalProperties
|
||||
- parameter param: (body) request body
|
||||
- returns: Observable<Void>
|
||||
*/
|
||||
open class func testInlineAdditionalProperties(param: Any) -> Observable<Void> {
|
||||
return Observable.create { observer -> Disposable in
|
||||
testInlineAdditionalProperties(param: param) { error in
|
||||
if let error = error {
|
||||
observer.on(.error(error as Error))
|
||||
} else {
|
||||
observer.on(.next())
|
||||
}
|
||||
observer.on(.completed)
|
||||
}
|
||||
return Disposables.create()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
test inline additionalProperties
|
||||
- POST /fake/inline-additionalProperties
|
||||
-
|
||||
|
||||
- parameter param: (body) request body
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testInlineAdditionalPropertiesWithRequestBuilder(param: Any) -> RequestBuilder<Void> {
|
||||
let path = "/fake/inline-additionalProperties"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = param.encodeToJSON()
|
||||
|
||||
let url = NSURLComponents(string: URLString)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true)
|
||||
}
|
||||
|
||||
/**
|
||||
test json serialization of form data
|
||||
- parameter param: (form) field1
|
||||
|
@ -118,16 +118,12 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
else {
|
||||
mpForm.append(fileURL, withName: k)
|
||||
}
|
||||
break
|
||||
case let string as String:
|
||||
mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k)
|
||||
break
|
||||
case let number as NSNumber:
|
||||
mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k)
|
||||
break
|
||||
default:
|
||||
fatalError("Unprocessable value \(v) with key \(k)")
|
||||
break
|
||||
}
|
||||
}
|
||||
}, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in
|
||||
@ -206,7 +202,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
validatedRequest.responseData(completionHandler: { (dataResponse) in
|
||||
cleanupRequest()
|
||||
|
||||
if (dataResponse.result.isFailure) {
|
||||
if dataResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.HttpError(statusCode: dataResponse.response?.statusCode ?? 500, data: dataResponse.data, error: dataResponse.result.error!)
|
||||
|
@ -53,7 +53,7 @@ extension Dictionary: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
var dictionary = [AnyHashable: Any]()
|
||||
for (key, value) in self {
|
||||
dictionary[key as! NSObject] = encodeIfPossible(value)
|
||||
dictionary[key] = encodeIfPossible(value)
|
||||
}
|
||||
return dictionary as Any
|
||||
}
|
||||
|
@ -29,8 +29,8 @@ open class Response<T> {
|
||||
public convenience init(response: HTTPURLResponse, body: T?) {
|
||||
let rawHeader = response.allHeaderFields
|
||||
var header = [String:String]()
|
||||
for (key, value) in rawHeader {
|
||||
header[key as! String] = value as? String
|
||||
for case let (key, value) as (String, String) in rawHeader {
|
||||
header[key] = value
|
||||
}
|
||||
self.init(statusCode: response.statusCode, header: header, body: body)
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
github "Alamofire/Alamofire" >= 3.1.0
|
||||
github "Alamofire/Alamofire" ~> 4.5
|
@ -1,5 +1,5 @@
|
||||
//
|
||||
// AnotherfakeAPI.swift
|
||||
// AnotherFakeAPI.swift
|
||||
//
|
||||
// Generated by swagger-codegen
|
||||
// https://github.com/swagger-api/swagger-codegen
|
||||
@ -9,7 +9,7 @@ import Foundation
|
||||
import Alamofire
|
||||
|
||||
|
||||
open class AnotherfakeAPI: APIBase {
|
||||
open class AnotherFakeAPI: APIBase {
|
||||
/**
|
||||
To test special tags
|
||||
- parameter body: (body) client model
|
||||
|
@ -381,6 +381,38 @@ open class FakeAPI: APIBase {
|
||||
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
test inline additionalProperties
|
||||
- parameter param: (body) request body
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testInlineAdditionalProperties(param: Any, completion: @escaping ((_ error: ErrorResponse?) -> Void)) {
|
||||
testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in
|
||||
completion(error)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
test inline additionalProperties
|
||||
- POST /fake/inline-additionalProperties
|
||||
-
|
||||
|
||||
- parameter param: (body) request body
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testInlineAdditionalPropertiesWithRequestBuilder(param: Any) -> RequestBuilder<Void> {
|
||||
let path = "/fake/inline-additionalProperties"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = param.encodeToJSON()
|
||||
|
||||
let url = NSURLComponents(string: URLString)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true)
|
||||
}
|
||||
|
||||
/**
|
||||
test json serialization of form data
|
||||
- parameter param: (form) field1
|
||||
|
@ -118,16 +118,12 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
else {
|
||||
mpForm.append(fileURL, withName: k)
|
||||
}
|
||||
break
|
||||
case let string as String:
|
||||
mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k)
|
||||
break
|
||||
case let number as NSNumber:
|
||||
mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k)
|
||||
break
|
||||
default:
|
||||
fatalError("Unprocessable value \(v) with key \(k)")
|
||||
break
|
||||
}
|
||||
}
|
||||
}, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in
|
||||
@ -206,7 +202,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
validatedRequest.responseData(completionHandler: { (dataResponse) in
|
||||
cleanupRequest()
|
||||
|
||||
if (dataResponse.result.isFailure) {
|
||||
if dataResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.HttpError(statusCode: dataResponse.response?.statusCode ?? 500, data: dataResponse.data, error: dataResponse.result.error!)
|
||||
|
@ -53,7 +53,7 @@ extension Dictionary: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
var dictionary = [AnyHashable: Any]()
|
||||
for (key, value) in self {
|
||||
dictionary[key as! NSObject] = encodeIfPossible(value)
|
||||
dictionary[key] = encodeIfPossible(value)
|
||||
}
|
||||
return dictionary as Any
|
||||
}
|
||||
|
@ -29,8 +29,8 @@ open class Response<T> {
|
||||
public convenience init(response: HTTPURLResponse, body: T?) {
|
||||
let rawHeader = response.allHeaderFields
|
||||
var header = [String:String]()
|
||||
for (key, value) in rawHeader {
|
||||
header[key as! String] = value as? String
|
||||
for case let (key, value) as (String, String) in rawHeader {
|
||||
header[key] = value
|
||||
}
|
||||
self.init(statusCode: response.statusCode, header: header, body: body)
|
||||
}
|
||||
|
@ -1,23 +0,0 @@
|
||||
# Swagger Codegen Ignore
|
||||
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
@ -1 +1 @@
|
||||
github "Alamofire/Alamofire" >= 3.1.0
|
||||
github "Alamofire/Alamofire" ~> 4.5.0
|
||||
|
@ -1,49 +0,0 @@
|
||||
//
|
||||
// FakeclassnametagsAPI.swift
|
||||
//
|
||||
// Generated by swagger-codegen
|
||||
// https://github.com/swagger-api/swagger-codegen
|
||||
//
|
||||
|
||||
import Alamofire
|
||||
|
||||
|
||||
|
||||
open class FakeclassnametagsAPI {
|
||||
/**
|
||||
To test class name in snake case
|
||||
|
||||
- parameter body: (body) client model
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testClassname(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) {
|
||||
testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in
|
||||
completion(response?.body, error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
To test class name in snake case
|
||||
- PATCH /fake_classname_test
|
||||
- examples: [{contentType=application/json, example={
|
||||
"client" : "aeiou"
|
||||
}}]
|
||||
|
||||
- parameter body: (body) client model
|
||||
|
||||
- returns: RequestBuilder<Client>
|
||||
*/
|
||||
open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder<Client> {
|
||||
let path = "/fake_classname_test"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let convertedParameters = APIHelper.convertBoolToString(parameters)
|
||||
|
||||
let requestBuilder: RequestBuilder<Client>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "PATCH", URLString: URLString, parameters: convertedParameters, isBody: true)
|
||||
}
|
||||
|
||||
}
|
@ -77,16 +77,12 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
else {
|
||||
mpForm.append(fileURL, withName: k)
|
||||
}
|
||||
break
|
||||
case let string as String:
|
||||
mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k)
|
||||
break
|
||||
case let number as NSNumber:
|
||||
mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k)
|
||||
break
|
||||
default:
|
||||
fatalError("Unprocessable value \(v) with key \(k)")
|
||||
break
|
||||
}
|
||||
}
|
||||
}, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in
|
||||
@ -97,7 +93,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
}
|
||||
self.processRequest(request: upload, managerId, completion)
|
||||
case .failure(let encodingError):
|
||||
completion(nil, ErrorResponse.Error(415, nil, encodingError))
|
||||
completion(nil, ErrorResponse.error(415, nil, encodingError))
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@ -129,7 +125,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
if stringResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.Error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!)
|
||||
ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -186,9 +182,9 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
)
|
||||
|
||||
} catch let requestParserError as DownloadException {
|
||||
completion(nil, ErrorResponse.Error(400, dataResponse.data, requestParserError))
|
||||
completion(nil, ErrorResponse.error(400, dataResponse.data, requestParserError))
|
||||
} catch let error {
|
||||
completion(nil, ErrorResponse.Error(400, dataResponse.data, error))
|
||||
completion(nil, ErrorResponse.error(400, dataResponse.data, error))
|
||||
}
|
||||
return
|
||||
})
|
||||
@ -199,7 +195,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
if voidResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.Error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -215,10 +211,10 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T> {
|
||||
validatedRequest.responseData(completionHandler: { (dataResponse) in
|
||||
cleanupRequest()
|
||||
|
||||
if (dataResponse.result.isFailure) {
|
||||
if dataResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.Error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -331,7 +327,7 @@ open class AlamofireDecodableRequestBuilder<T:Decodable>: AlamofireRequestBuilde
|
||||
if stringResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.Error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!)
|
||||
ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -351,7 +347,7 @@ open class AlamofireDecodableRequestBuilder<T:Decodable>: AlamofireRequestBuilde
|
||||
if voidResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.Error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -367,10 +363,10 @@ open class AlamofireDecodableRequestBuilder<T:Decodable>: AlamofireRequestBuilde
|
||||
validatedRequest.responseData(completionHandler: { (dataResponse) in
|
||||
cleanupRequest()
|
||||
|
||||
if (dataResponse.result.isFailure) {
|
||||
if dataResponse.result.isFailure {
|
||||
completion(
|
||||
nil,
|
||||
ErrorResponse.Error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)
|
||||
)
|
||||
return
|
||||
}
|
||||
@ -388,17 +384,17 @@ open class AlamofireDecodableRequestBuilder<T:Decodable>: AlamofireRequestBuilde
|
||||
cleanupRequest()
|
||||
|
||||
guard dataResponse.result.isSuccess else {
|
||||
completion(nil, ErrorResponse.Error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!))
|
||||
completion(nil, ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!))
|
||||
return
|
||||
}
|
||||
|
||||
guard let data = dataResponse.data, !data.isEmpty else {
|
||||
completion(nil, ErrorResponse.Error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse))
|
||||
completion(nil, ErrorResponse.error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse))
|
||||
return
|
||||
}
|
||||
|
||||
guard let httpResponse = dataResponse.response else {
|
||||
completion(nil, ErrorResponse.Error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse))
|
||||
completion(nil, ErrorResponse.error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse))
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -22,9 +22,12 @@ open class CodableHelper {
|
||||
decoder.dateDecodingStrategy = .formatted(df)
|
||||
} else {
|
||||
decoder.dataDecodingStrategy = .base64
|
||||
if #available(iOS 10.0, *) {
|
||||
decoder.dateDecodingStrategy = .iso8601
|
||||
}
|
||||
let formatter = DateFormatter()
|
||||
formatter.calendar = Calendar(identifier: .iso8601)
|
||||
formatter.locale = Locale(identifier: "en_US_POSIX")
|
||||
formatter.timeZone = TimeZone(secondsFromGMT: 0)
|
||||
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX"
|
||||
decoder.dateDecodingStrategy = .formatted(formatter)
|
||||
}
|
||||
|
||||
do {
|
||||
@ -45,9 +48,12 @@ open class CodableHelper {
|
||||
encoder.outputFormatting = .prettyPrinted
|
||||
}
|
||||
encoder.dataEncodingStrategy = .base64
|
||||
if #available(iOS 10.0, *) {
|
||||
encoder.dateEncodingStrategy = .iso8601
|
||||
}
|
||||
let formatter = DateFormatter()
|
||||
formatter.calendar = Calendar(identifier: .iso8601)
|
||||
formatter.locale = Locale(identifier: "en_US_POSIX")
|
||||
formatter.timeZone = TimeZone(secondsFromGMT: 0)
|
||||
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX"
|
||||
encoder.dateEncodingStrategy = .formatted(formatter)
|
||||
|
||||
do {
|
||||
returnedData = try encoder.encode(value)
|
||||
|
@ -53,7 +53,7 @@ extension Dictionary: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
var dictionary = [AnyHashable: Any]()
|
||||
for (key, value) in self {
|
||||
dictionary[key as! NSObject] = encodeIfPossible(value)
|
||||
dictionary[key] = encodeIfPossible(value)
|
||||
}
|
||||
return dictionary as Any
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ protocol JSONEncodable {
|
||||
}
|
||||
|
||||
public enum ErrorResponse : Error {
|
||||
case Error(Int, Data?, Error)
|
||||
case error(Int, Data?, Error)
|
||||
}
|
||||
|
||||
open class Response<T> {
|
||||
@ -28,8 +28,8 @@ open class Response<T> {
|
||||
public convenience init(response: HTTPURLResponse, body: T?) {
|
||||
let rawHeader = response.allHeaderFields
|
||||
var header = [String:String]()
|
||||
for (key, value) in rawHeader {
|
||||
header[key as! String] = value as? String
|
||||
for case let (key, value) as (String, String) in rawHeader {
|
||||
header[key] = value
|
||||
}
|
||||
self.init(statusCode: response.statusCode, header: header, body: body)
|
||||
}
|
||||
|
@ -15,10 +15,12 @@ open class AdditionalPropertiesClass: Codable {
|
||||
public var mapOfMapProperty: [String:[String:String]]?
|
||||
|
||||
|
||||
|
||||
public init(mapProperty: [String:String]?, mapOfMapProperty: [String:[String:String]]?) {
|
||||
self.mapProperty = mapProperty
|
||||
self.mapOfMapProperty = mapOfMapProperty
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -15,10 +15,12 @@ open class Animal: Codable {
|
||||
public var color: String?
|
||||
|
||||
|
||||
|
||||
public init(className: String, color: String?) {
|
||||
self.className = className
|
||||
self.color = color
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -16,11 +16,13 @@ open class ApiResponse: Codable {
|
||||
public var message: String?
|
||||
|
||||
|
||||
|
||||
public init(code: Int?, type: String?, message: String?) {
|
||||
self.code = code
|
||||
self.type = type
|
||||
self.message = message
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -14,9 +14,11 @@ open class ArrayOfArrayOfNumberOnly: Codable {
|
||||
public var arrayArrayNumber: [[Double]]?
|
||||
|
||||
|
||||
|
||||
public init(arrayArrayNumber: [[Double]]?) {
|
||||
self.arrayArrayNumber = arrayArrayNumber
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
@ -24,7 +26,7 @@ open class ArrayOfArrayOfNumberOnly: Codable {
|
||||
|
||||
var container = encoder.container(keyedBy: String.self)
|
||||
|
||||
try container.encodeArrayIfPresent(arrayArrayNumber, forKey: "ArrayArrayNumber")
|
||||
try container.encodeIfPresent(arrayArrayNumber, forKey: "ArrayArrayNumber")
|
||||
}
|
||||
|
||||
// Decodable protocol methods
|
||||
@ -32,7 +34,7 @@ open class ArrayOfArrayOfNumberOnly: Codable {
|
||||
public required init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: String.self)
|
||||
|
||||
arrayArrayNumber = try container.decodeArrayIfPresent([Double].self, forKey: "ArrayArrayNumber")
|
||||
arrayArrayNumber = try container.decodeIfPresent([[Double]].self, forKey: "ArrayArrayNumber")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,9 +14,11 @@ open class ArrayOfNumberOnly: Codable {
|
||||
public var arrayNumber: [Double]?
|
||||
|
||||
|
||||
|
||||
public init(arrayNumber: [Double]?) {
|
||||
self.arrayNumber = arrayNumber
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
@ -24,7 +26,7 @@ open class ArrayOfNumberOnly: Codable {
|
||||
|
||||
var container = encoder.container(keyedBy: String.self)
|
||||
|
||||
try container.encodeArrayIfPresent(arrayNumber, forKey: "ArrayNumber")
|
||||
try container.encodeIfPresent(arrayNumber, forKey: "ArrayNumber")
|
||||
}
|
||||
|
||||
// Decodable protocol methods
|
||||
@ -32,7 +34,7 @@ open class ArrayOfNumberOnly: Codable {
|
||||
public required init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: String.self)
|
||||
|
||||
arrayNumber = try container.decodeArrayIfPresent(Double.self, forKey: "ArrayNumber")
|
||||
arrayNumber = try container.decodeIfPresent([Double].self, forKey: "ArrayNumber")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,11 +16,13 @@ open class ArrayTest: Codable {
|
||||
public var arrayArrayOfModel: [[ReadOnlyFirst]]?
|
||||
|
||||
|
||||
|
||||
public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) {
|
||||
self.arrayOfString = arrayOfString
|
||||
self.arrayArrayOfInteger = arrayArrayOfInteger
|
||||
self.arrayArrayOfModel = arrayArrayOfModel
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
@ -28,9 +30,9 @@ open class ArrayTest: Codable {
|
||||
|
||||
var container = encoder.container(keyedBy: String.self)
|
||||
|
||||
try container.encodeArrayIfPresent(arrayOfString, forKey: "array_of_string")
|
||||
try container.encodeArrayIfPresent(arrayArrayOfInteger, forKey: "array_array_of_integer")
|
||||
try container.encodeArrayIfPresent(arrayArrayOfModel, forKey: "array_array_of_model")
|
||||
try container.encodeIfPresent(arrayOfString, forKey: "array_of_string")
|
||||
try container.encodeIfPresent(arrayArrayOfInteger, forKey: "array_array_of_integer")
|
||||
try container.encodeIfPresent(arrayArrayOfModel, forKey: "array_array_of_model")
|
||||
}
|
||||
|
||||
// Decodable protocol methods
|
||||
@ -38,9 +40,9 @@ open class ArrayTest: Codable {
|
||||
public required init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: String.self)
|
||||
|
||||
arrayOfString = try container.decodeArrayIfPresent(String.self, forKey: "array_of_string")
|
||||
arrayArrayOfInteger = try container.decodeArrayIfPresent([Int64].self, forKey: "array_array_of_integer")
|
||||
arrayArrayOfModel = try container.decodeArrayIfPresent([ReadOnlyFirst].self, forKey: "array_array_of_model")
|
||||
arrayOfString = try container.decodeIfPresent([String].self, forKey: "array_of_string")
|
||||
arrayArrayOfInteger = try container.decodeIfPresent([[Int64]].self, forKey: "array_array_of_integer")
|
||||
arrayArrayOfModel = try container.decodeIfPresent([[ReadOnlyFirst]].self, forKey: "array_array_of_model")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@ open class Capitalization: Codable {
|
||||
public var ATT_NAME: String?
|
||||
|
||||
|
||||
|
||||
public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) {
|
||||
self.smallCamel = smallCamel
|
||||
self.capitalCamel = capitalCamel
|
||||
@ -28,6 +29,7 @@ open class Capitalization: Codable {
|
||||
self.sCAETHFlowPoints = sCAETHFlowPoints
|
||||
self.ATT_NAME = ATT_NAME
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -14,9 +14,7 @@ open class Cat: Animal {
|
||||
public var declawed: Bool?
|
||||
|
||||
|
||||
public init(declawed: Bool?) {
|
||||
self.declawed = declawed
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
@ -29,10 +27,11 @@ open class Cat: Animal {
|
||||
|
||||
// Decodable protocol methods
|
||||
|
||||
public override required init(from decoder: Decoder) throws {
|
||||
public required init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: String.self)
|
||||
|
||||
declawed = try container.decodeIfPresent(Bool.self, forKey: "declawed")
|
||||
try super.init(from: decoder)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,10 +15,12 @@ open class Category: Codable {
|
||||
public var name: String?
|
||||
|
||||
|
||||
|
||||
public init(id: Int64?, name: String?) {
|
||||
self.id = id
|
||||
self.name = name
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -15,9 +15,11 @@ open class ClassModel: Codable {
|
||||
public var _class: String?
|
||||
|
||||
|
||||
|
||||
public init(_class: String?) {
|
||||
self._class = _class
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -14,9 +14,11 @@ open class Client: Codable {
|
||||
public var client: String?
|
||||
|
||||
|
||||
|
||||
public init(client: String?) {
|
||||
self.client = client
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -14,9 +14,7 @@ open class Dog: Animal {
|
||||
public var breed: String?
|
||||
|
||||
|
||||
public init(breed: String?) {
|
||||
self.breed = breed
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
@ -29,10 +27,11 @@ open class Dog: Animal {
|
||||
|
||||
// Decodable protocol methods
|
||||
|
||||
public override required init(from decoder: Decoder) throws {
|
||||
public required init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: String.self)
|
||||
|
||||
breed = try container.decodeIfPresent(String.self, forKey: "breed")
|
||||
try super.init(from: decoder)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,10 +23,12 @@ open class EnumArrays: Codable {
|
||||
public var arrayEnum: [ArrayEnum]?
|
||||
|
||||
|
||||
|
||||
public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) {
|
||||
self.justSymbol = justSymbol
|
||||
self.arrayEnum = arrayEnum
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
@ -35,7 +37,7 @@ open class EnumArrays: Codable {
|
||||
var container = encoder.container(keyedBy: String.self)
|
||||
|
||||
try container.encodeIfPresent(justSymbol, forKey: "just_symbol")
|
||||
try container.encodeArrayIfPresent(arrayEnum, forKey: "array_enum")
|
||||
try container.encodeIfPresent(arrayEnum, forKey: "array_enum")
|
||||
}
|
||||
|
||||
// Decodable protocol methods
|
||||
@ -44,7 +46,7 @@ open class EnumArrays: Codable {
|
||||
let container = try decoder.container(keyedBy: String.self)
|
||||
|
||||
justSymbol = try container.decodeIfPresent(JustSymbol.self, forKey: "just_symbol")
|
||||
arrayEnum = try container.decodeArrayIfPresent(String.self, forKey: "array_enum")
|
||||
arrayEnum = try container.decodeIfPresent([ArrayEnum].self, forKey: "array_enum")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,12 +30,14 @@ open class EnumTest: Codable {
|
||||
public var outerEnum: OuterEnum?
|
||||
|
||||
|
||||
|
||||
public init(enumString: EnumString?, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) {
|
||||
self.enumString = enumString
|
||||
self.enumInteger = enumInteger
|
||||
self.enumNumber = enumNumber
|
||||
self.outerEnum = outerEnum
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -26,6 +26,7 @@ open class FormatTest: Codable {
|
||||
public var password: String
|
||||
|
||||
|
||||
|
||||
public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: Data?, date: Date, dateTime: Date?, uuid: UUID?, password: String) {
|
||||
self.integer = integer
|
||||
self.int32 = int32
|
||||
@ -41,6 +42,7 @@ open class FormatTest: Codable {
|
||||
self.uuid = uuid
|
||||
self.password = password
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -15,10 +15,12 @@ open class HasOnlyReadOnly: Codable {
|
||||
public var foo: String?
|
||||
|
||||
|
||||
|
||||
public init(bar: String?, foo: String?) {
|
||||
self.bar = bar
|
||||
self.foo = foo
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -14,9 +14,11 @@ open class List: Codable {
|
||||
public var _123List: String?
|
||||
|
||||
|
||||
|
||||
public init(_123List: String?) {
|
||||
self._123List = _123List
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -19,10 +19,12 @@ open class MapTest: Codable {
|
||||
public var mapOfEnumString: [String:String]?
|
||||
|
||||
|
||||
|
||||
public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?) {
|
||||
self.mapMapOfString = mapMapOfString
|
||||
self.mapOfEnumString = mapOfEnumString
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -16,11 +16,13 @@ open class MixedPropertiesAndAdditionalPropertiesClass: Codable {
|
||||
public var map: [String:Animal]?
|
||||
|
||||
|
||||
|
||||
public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) {
|
||||
self.uuid = uuid
|
||||
self.dateTime = dateTime
|
||||
self.map = map
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -16,10 +16,12 @@ open class Model200Response: Codable {
|
||||
public var _class: String?
|
||||
|
||||
|
||||
|
||||
public init(name: Int?, _class: String?) {
|
||||
self.name = name
|
||||
self._class = _class
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -18,12 +18,14 @@ open class Name: Codable {
|
||||
public var _123Number: Int?
|
||||
|
||||
|
||||
|
||||
public init(name: Int, snakeCase: Int?, property: String?, _123Number: Int?) {
|
||||
self.name = name
|
||||
self.snakeCase = snakeCase
|
||||
self.property = property
|
||||
self._123Number = _123Number
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -14,9 +14,11 @@ open class NumberOnly: Codable {
|
||||
public var justNumber: Double?
|
||||
|
||||
|
||||
|
||||
public init(justNumber: Double?) {
|
||||
self.justNumber = justNumber
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -25,6 +25,7 @@ open class Order: Codable {
|
||||
public var complete: Bool?
|
||||
|
||||
|
||||
|
||||
public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) {
|
||||
self.id = id
|
||||
self.petId = petId
|
||||
@ -33,6 +34,7 @@ open class Order: Codable {
|
||||
self.status = status
|
||||
self.complete = complete
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -13,6 +13,7 @@ open class OuterBoolean: Codable {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -16,11 +16,13 @@ open class OuterComposite: Codable {
|
||||
public var myBoolean: OuterBoolean?
|
||||
|
||||
|
||||
|
||||
public init(myNumber: OuterNumber?, myString: OuterString?, myBoolean: OuterBoolean?) {
|
||||
self.myNumber = myNumber
|
||||
self.myString = myString
|
||||
self.myBoolean = myBoolean
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -13,6 +13,7 @@ open class OuterNumber: Codable {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -13,6 +13,7 @@ open class OuterString: Codable {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -25,6 +25,7 @@ open class Pet: Codable {
|
||||
public var status: Status?
|
||||
|
||||
|
||||
|
||||
public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) {
|
||||
self.id = id
|
||||
self.category = category
|
||||
@ -33,6 +34,7 @@ open class Pet: Codable {
|
||||
self.tags = tags
|
||||
self.status = status
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
@ -43,8 +45,8 @@ open class Pet: Codable {
|
||||
try container.encodeIfPresent(id, forKey: "id")
|
||||
try container.encodeIfPresent(category, forKey: "category")
|
||||
try container.encode(name, forKey: "name")
|
||||
try container.encodeArray(photoUrls, forKey: "photoUrls")
|
||||
try container.encodeArrayIfPresent(tags, forKey: "tags")
|
||||
try container.encode(photoUrls, forKey: "photoUrls")
|
||||
try container.encodeIfPresent(tags, forKey: "tags")
|
||||
try container.encodeIfPresent(status, forKey: "status")
|
||||
}
|
||||
|
||||
@ -56,8 +58,8 @@ open class Pet: Codable {
|
||||
id = try container.decodeIfPresent(Int64.self, forKey: "id")
|
||||
category = try container.decodeIfPresent(Category.self, forKey: "category")
|
||||
name = try container.decode(String.self, forKey: "name")
|
||||
photoUrls = try container.decodeArray(String.self, forKey: "photoUrls")
|
||||
tags = try container.decodeArrayIfPresent(Tag.self, forKey: "tags")
|
||||
photoUrls = try container.decode([String].self, forKey: "photoUrls")
|
||||
tags = try container.decodeIfPresent([Tag].self, forKey: "tags")
|
||||
status = try container.decodeIfPresent(Status.self, forKey: "status")
|
||||
}
|
||||
}
|
||||
|
@ -15,10 +15,12 @@ open class ReadOnlyFirst: Codable {
|
||||
public var baz: String?
|
||||
|
||||
|
||||
|
||||
public init(bar: String?, baz: String?) {
|
||||
self.bar = bar
|
||||
self.baz = baz
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -15,9 +15,11 @@ open class Return: Codable {
|
||||
public var _return: Int?
|
||||
|
||||
|
||||
|
||||
public init(_return: Int?) {
|
||||
self._return = _return
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -14,9 +14,11 @@ open class SpecialModelName: Codable {
|
||||
public var specialPropertyName: Int64?
|
||||
|
||||
|
||||
|
||||
public init(specialPropertyName: Int64?) {
|
||||
self.specialPropertyName = specialPropertyName
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -15,10 +15,12 @@ open class Tag: Codable {
|
||||
public var name: String?
|
||||
|
||||
|
||||
|
||||
public init(id: Int64?, name: String?) {
|
||||
self.id = id
|
||||
self.name = name
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -22,6 +22,7 @@ open class User: Codable {
|
||||
public var userStatus: Int?
|
||||
|
||||
|
||||
|
||||
public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) {
|
||||
self.id = id
|
||||
self.username = username
|
||||
@ -32,6 +33,7 @@ open class User: Codable {
|
||||
self.phone = phone
|
||||
self.userStatus = userStatus
|
||||
}
|
||||
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
3E11073F08C80332AEFC3A10FC489313 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3862A83F9BE857B1E903ABBBDE37EF7 /* AnimalFarm.swift */; };
|
||||
3F3B788CC8A53F01CE6A1B33D4052D80 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; };
|
||||
424F25F3C040D2362DD353C82A86740B /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
472DF233EF1CA028A52DB57F87A5687F /* Fake_classname_tags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AE3690E05FA4B6B3A8600FCA1631D8C /* Fake_classname_tags123API.swift */; };
|
||||
472DF233EF1CA028A52DB57F87A5687F /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AE3690E05FA4B6B3A8600FCA1631D8C /* FakeClassnameTags123API.swift */; };
|
||||
4814A739814A3809C4D9C61F96012C62 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7417953898146193F86A165CD5F3AF4A /* Category.swift */; };
|
||||
4CBD58C64013924FB5A74A106D838285 /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9776B33259DFB803A3E6D9573FA3DE3E /* FormatTest.swift */; };
|
||||
4DF5B60FEFEAC2BA370EE79D2567B3E9 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4B3F69D54C19FC502362EEE3544ECA0 /* User.swift */; };
|
||||
@ -72,6 +72,7 @@
|
||||
C888F5D0484D08C3F110B48DF18DDFD6 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87DCB85380B2EC22CFE743BEDE7E4114 /* Return.swift */; };
|
||||
CA6B474618AA720ABFB571F69B227AF7 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13C6EEF1D81A0C523AE569F1732AC8DC /* OuterEnum.swift */; };
|
||||
CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */; };
|
||||
D54B91C71FC0918800319969 /* AnotherfakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = D54B91C61FC0918800319969 /* AnotherfakeAPI.swift */; };
|
||||
D5F1BBD60108412FD5C8B320D20B2993 /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */; };
|
||||
DE8F9190013C0FECA7C3413F214B2BAB /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3102957D0FBF5FFA80969BB2A15F8FF /* ApiResponse.swift */; };
|
||||
E05C5957E89CE7129CC4880299444A81 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1FF93AC280A80800873A20A8F72AD29 /* Pet.swift */; };
|
||||
@ -87,7 +88,6 @@
|
||||
F81E110F1F9AAD6C448DCF5DF99C2F41 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B8F990A8905B95231C6D1955750D23C /* Client.swift */; };
|
||||
F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */; };
|
||||
F9884BC36100EA0FC9AAABAC5D4A0371 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DF7C9C577375BE47CAE380DE3EBE19 /* HasOnlyReadOnly.swift */; };
|
||||
FBB089E4407481B7A92F96EEC803A04D /* FakeclassnametagsAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85A2666A7F91E968D48E2EEC1623BB02 /* FakeclassnametagsAPI.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@ -115,7 +115,7 @@
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = "<group>"; };
|
||||
00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = "<group>"; };
|
||||
02E62B78D97471D708B23605FCAA9EA1 /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = "<group>"; };
|
||||
02F28E719AA874BE9213D6CF8CE7E36B /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = "<group>"; };
|
||||
04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = "<group>"; };
|
||||
@ -135,8 +135,8 @@
|
||||
28F73294B64CD8821EC2467CB7F1F073 /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = "<group>"; };
|
||||
291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = "<group>"; };
|
||||
2A332587F10679E262455F979B3D1055 /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = "<group>"; };
|
||||
2ACC287E45C0FCE8717A34B8ECA88A30 /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PetstoreClient.modulemap; sourceTree = "<group>"; };
|
||||
2AE3690E05FA4B6B3A8600FCA1631D8C /* Fake_classname_tags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Fake_classname_tags123API.swift; sourceTree = "<group>"; };
|
||||
2ACC287E45C0FCE8717A34B8ECA88A30 /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = PetstoreClient.modulemap; sourceTree = "<group>"; };
|
||||
2AE3690E05FA4B6B3A8600FCA1631D8C /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = "<group>"; };
|
||||
2C0EF68B5117187E979D1DE4ECDB938E /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = "<group>"; };
|
||||
2FF17440CCD2E1A69791A4AA23325AD5 /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = "<group>"; };
|
||||
30B827D77F92D24E6D24561F491F2A50 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = "<group>"; };
|
||||
@ -157,7 +157,7 @@
|
||||
466D426E7AA31C27ABC601DD606EF126 /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = JSONEncodableEncoding.swift; path = PetstoreClient/Classes/Swaggers/JSONEncodableEncoding.swift; sourceTree = "<group>"; };
|
||||
46CDAC6C1187C5467E576980E1062C8B /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = "<group>"; };
|
||||
475EFFB863F38801DE73965C1438E2FF /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = "<group>"; };
|
||||
49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
4A0977DBA9BAE46013DFD65E4400A0CB /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = "<group>"; };
|
||||
4AF006B0AD5765D1BFA8253C2DCBB126 /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = "<group>"; };
|
||||
549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
@ -167,25 +167,24 @@
|
||||
6639346628280A0D0FAD35196BF56108 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = "<group>"; };
|
||||
66A46F517F0AF7E85A16D723F6406896 /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = "<group>"; };
|
||||
687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = "<group>"; };
|
||||
6C0ACB269F0C836F1865A56C4AF7A07E /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
6C0ACB269F0C836F1865A56C4AF7A07E /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
7417953898146193F86A165CD5F3AF4A /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = "<group>"; };
|
||||
7C6145F09A87143B7FC501BE989C8BBD /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = "<group>"; };
|
||||
7C8E63660D346FD8ED2A97242E74EA09 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
7D141D1953E5C6E67E362CE73090E48A /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = "<group>"; };
|
||||
7D141D1953E5C6E67E362CE73090E48A /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Alamofire.modulemap; sourceTree = "<group>"; };
|
||||
7EA034E64EC60C1FCC5609CA9962CD51 /* CodableHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CodableHelper.swift; path = PetstoreClient/Classes/Swaggers/CodableHelper.swift; sourceTree = "<group>"; };
|
||||
849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
854F6A83AC5201A267F39995BF249D32 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AlamofireImplementations.swift; path = PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift; sourceTree = "<group>"; };
|
||||
85A2666A7F91E968D48E2EEC1623BB02 /* FakeclassnametagsAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeclassnametagsAPI.swift; sourceTree = "<group>"; };
|
||||
8689097AED0350F905AFA5B0962FA969 /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = "<group>"; };
|
||||
86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = "<group>"; };
|
||||
87882A1F5A92C8138D54545E51D51E6F /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = "<group>"; };
|
||||
87DCB85380B2EC22CFE743BEDE7E4114 /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = "<group>"; };
|
||||
88EC57640E276EA2387256530FB1F868 /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = "<group>"; };
|
||||
897799EBBCCE802354256F9E7984C2CF /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = "<group>"; };
|
||||
897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8B87E0BA794A79025212F37D32449C63 /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = "<group>"; };
|
||||
93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
|
||||
93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
|
||||
969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
9776B33259DFB803A3E6D9573FA3DE3E /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = "<group>"; };
|
||||
A01C037B4034EDA3D7955BC5E4E9D9D6 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = "<group>"; };
|
||||
@ -205,8 +204,9 @@
|
||||
C7E7932024A79370E61700F5FD439D37 /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = "<group>"; };
|
||||
C925A1EF89E6AF23AE6EA4BA515A6E11 /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = "<group>"; };
|
||||
D2841E5E2183846280B97F6E660DA26C /* Pods-SwaggerClient-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-resources.sh"; sourceTree = "<group>"; };
|
||||
D54B91C61FC0918800319969 /* AnotherfakeAPI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnotherfakeAPI.swift; sourceTree = "<group>"; };
|
||||
DB3DDF6C3277994828CD09F3155BB74E /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = JSONEncodingHelper.swift; path = PetstoreClient/Classes/Swaggers/JSONEncodingHelper.swift; sourceTree = "<group>"; };
|
||||
DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClient.modulemap"; sourceTree = "<group>"; };
|
||||
DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-SwaggerClient.modulemap"; sourceTree = "<group>"; };
|
||||
DF26681AB7FB981F237CD8EA4F059708 /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = "<group>"; };
|
||||
DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = "<group>"; };
|
||||
E0A482A15F21B4BC206B31E7A0FAB79F /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = "<group>"; };
|
||||
@ -216,7 +216,7 @@
|
||||
E4E6F4A58FE7868CA2177D3AC79AD2FA /* Pods-SwaggerClientTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-resources.sh"; sourceTree = "<group>"; };
|
||||
E5A8AA5F9EDED0A0BDDE7E830BF4AEE0 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = "<group>"; };
|
||||
E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = "<group>"; };
|
||||
EA3FFA48FB4D08FC02C47F71C0089CD9 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
EA3FFA48FB4D08FC02C47F71C0089CD9 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
EB834CA4A0478028D959D9EBD119D953 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
F05D3E8C18F8C0EF732558438FAA421A /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = PetstoreClient/Classes/Swaggers/Extensions.swift; sourceTree = "<group>"; };
|
||||
F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClientTests-umbrella.h"; sourceTree = "<group>"; };
|
||||
@ -283,7 +283,6 @@
|
||||
B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */,
|
||||
55F14F994FE7AB51F028BFE66CEF3106 /* Support Files */,
|
||||
);
|
||||
name = Alamofire;
|
||||
path = Alamofire;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@ -343,9 +342,9 @@
|
||||
7C3C4943F0B3A9E87CCF23AA96272CB5 /* APIs */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2AE3690E05FA4B6B3A8600FCA1631D8C /* Fake_classname_tags123API.swift */,
|
||||
D54B91C61FC0918800319969 /* AnotherfakeAPI.swift */,
|
||||
2AE3690E05FA4B6B3A8600FCA1631D8C /* FakeClassnameTags123API.swift */,
|
||||
7C6145F09A87143B7FC501BE989C8BBD /* FakeAPI.swift */,
|
||||
85A2666A7F91E968D48E2EEC1623BB02 /* FakeclassnametagsAPI.swift */,
|
||||
475EFFB863F38801DE73965C1438E2FF /* PetAPI.swift */,
|
||||
897799EBBCCE802354256F9E7984C2CF /* StoreAPI.swift */,
|
||||
158D0513D0844E7FE6AEFAEE70E88618 /* UserAPI.swift */,
|
||||
@ -700,9 +699,8 @@
|
||||
9145FC4EDCAF00080761172112D6B4E1 /* EnumClass.swift in Sources */,
|
||||
1982792C8B5D5B4999228D16CDBE3E28 /* EnumTest.swift in Sources */,
|
||||
B65AABE5C7EB03365333C4783B36CCDC /* Extensions.swift in Sources */,
|
||||
472DF233EF1CA028A52DB57F87A5687F /* Fake_classname_tags123API.swift in Sources */,
|
||||
472DF233EF1CA028A52DB57F87A5687F /* FakeClassnameTags123API.swift in Sources */,
|
||||
7EE07906770CB8D69F00429072D7DC02 /* FakeAPI.swift in Sources */,
|
||||
FBB089E4407481B7A92F96EEC803A04D /* FakeclassnametagsAPI.swift in Sources */,
|
||||
4CBD58C64013924FB5A74A106D838285 /* FormatTest.swift in Sources */,
|
||||
F9884BC36100EA0FC9AAABAC5D4A0371 /* HasOnlyReadOnly.swift in Sources */,
|
||||
8158ED5AEE2D6FE60EBA456F691D823C /* JSONEncodableEncoding.swift in Sources */,
|
||||
@ -715,6 +713,7 @@
|
||||
55F9C83CA76F9B2DA873122BEC278855 /* Name.swift in Sources */,
|
||||
7A854DC997BF3D7E3449FF58278EC967 /* NumberOnly.swift in Sources */,
|
||||
363930DE8DE4B17D8EF901F5C249A9AC /* Order.swift in Sources */,
|
||||
D54B91C71FC0918800319969 /* AnotherfakeAPI.swift in Sources */,
|
||||
F1ACDB1E74FDDF4609EA027BB6D5C9D8 /* OuterBoolean.swift in Sources */,
|
||||
707F832EEA6E7DD274201962E4D85B5B /* OuterComposite.swift in Sources */,
|
||||
CA6B474618AA720ABFB571F69B227AF7 /* OuterEnum.swift in Sources */,
|
||||
|
@ -1,63 +0,0 @@
|
||||
# Xcode
|
||||
#
|
||||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||
|
||||
## Build generated
|
||||
build/
|
||||
DerivedData
|
||||
|
||||
## Various settings
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata
|
||||
|
||||
## Other
|
||||
*.xccheckout
|
||||
*.moved-aside
|
||||
*.xcuserstate
|
||||
*.xcscmblueprint
|
||||
|
||||
## Obj-C/Swift specific
|
||||
*.hmap
|
||||
*.ipa
|
||||
|
||||
## Playgrounds
|
||||
timeline.xctimeline
|
||||
playground.xcworkspace
|
||||
|
||||
# Swift Package Manager
|
||||
#
|
||||
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
|
||||
# Packages/
|
||||
.build/
|
||||
|
||||
# CocoaPods
|
||||
#
|
||||
# We recommend against adding the Pods directory to your .gitignore. However
|
||||
# you should judge for yourself, the pros and cons are mentioned at:
|
||||
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
||||
#
|
||||
# Pods/
|
||||
|
||||
# Carthage
|
||||
#
|
||||
# Add this line if you want to avoid checking in source code from Carthage dependencies.
|
||||
# Carthage/Checkouts
|
||||
|
||||
Carthage/Build
|
||||
|
||||
# fastlane
|
||||
#
|
||||
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
||||
# screenshots whenever they are needed.
|
||||
# For more information about the recommended setup visit:
|
||||
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
|
||||
|
||||
fastlane/report.xml
|
||||
fastlane/screenshots
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user