diff --git a/samples/client/petstore/swift-promisekit/.swagger-codegen-ignore b/samples/client/petstore/swift-promisekit/.swagger-codegen-ignore new file mode 100644 index 0000000000..19d3377182 --- /dev/null +++ b/samples/client/petstore/swift-promisekit/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# 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 +# Thsi 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 diff --git a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Models.swift index 5a8eade51b..cad60a236a 100644 --- a/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Models.swift +++ b/samples/client/petstore/swift-promisekit/PetstoreClient/Classes/Swaggers/Models.swift @@ -34,17 +34,17 @@ public class Response { private var once = dispatch_once_t() class Decoders { static private var decoders = Dictionary AnyObject)>() - + static func addDecoder(clazz clazz: T.Type, decoder: ((AnyObject) -> T)) { let key = "\(T.self)" decoders[key] = { decoder($0) as! AnyObject } } - + static func decode(clazz clazz: [T].Type, source: AnyObject) -> [T] { let array = source as! [AnyObject] return array.map { Decoders.decode(clazz: T.self, source: $0) } } - + static func decode(clazz clazz: [Key:T].Type, source: AnyObject) -> [Key:T] { let sourceDictionary = source as! [Key: AnyObject] var dictionary = [Key:T]() @@ -53,7 +53,7 @@ class Decoders { } return dictionary } - + static func decode(clazz clazz: T.Type, source: AnyObject) -> T { initialize() if T.self is Int32.Type && source is NSNumber { @@ -65,7 +65,7 @@ class Decoders { if source is T { return source as! T } - + let key = "\(T.self)" if let decoder = decoders[key] { return decoder(source) as! T @@ -100,14 +100,15 @@ class Decoders { Decoders.decode(clazz: clazz, source: someSource) } } - + static private func initialize() { dispatch_once(&once) { let formatters = [ "yyyy-MM-dd", "yyyy-MM-dd'T'HH:mm:ssZZZZZ", "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss'Z'" + "yyyy-MM-dd'T'HH:mm:ss'Z'", + "yyyy-MM-dd'T'HH:mm:ss.SSS" ].map { (format: String) -> NSDateFormatter in let formatter = NSDateFormatter() formatter.dateFormat = format @@ -121,7 +122,7 @@ class Decoders { return date } } - + } if let sourceInt = source as? Int { // treat as a java date diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift-promisekit/SwaggerClientTests/Podfile.lock index cfeb949910..fa9ebeb16e 100644 --- a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Podfile.lock +++ b/samples/client/petstore/swift-promisekit/SwaggerClientTests/Podfile.lock @@ -1,12 +1,12 @@ PODS: - Alamofire (3.1.5) - - OMGHTTPURLRQ (3.1.1): - - OMGHTTPURLRQ/RQ (= 3.1.1) - - OMGHTTPURLRQ/FormURLEncode (3.1.1) - - OMGHTTPURLRQ/RQ (3.1.1): + - OMGHTTPURLRQ (3.1.2): + - OMGHTTPURLRQ/RQ (= 3.1.2) + - OMGHTTPURLRQ/FormURLEncode (3.1.2) + - OMGHTTPURLRQ/RQ (3.1.2): - OMGHTTPURLRQ/FormURLEncode - OMGHTTPURLRQ/UserAgent - - OMGHTTPURLRQ/UserAgent (3.1.1) + - OMGHTTPURLRQ/UserAgent (3.1.2) - PetstoreClient (0.0.1): - Alamofire (~> 3.1.5) - PromiseKit (~> 3.1.1) @@ -32,7 +32,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Alamofire: 5f730ba29fd113b7ddd71c1e65d0c630acf5d7b0 - OMGHTTPURLRQ: 633f98ee745aeda02345935a52eec1784cddb589 + OMGHTTPURLRQ: 38316b56d88125c600bcdb16df8329147da2b0ee PetstoreClient: efd495da2b7a6f3e798752702d59f96e306dbace PromiseKit: 4e8127c22a9b29d1b44958ab2ec762ea6115cbfb diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Manifest.lock b/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Manifest.lock index cfeb949910..fa9ebeb16e 100644 --- a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Manifest.lock +++ b/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Manifest.lock @@ -1,12 +1,12 @@ PODS: - Alamofire (3.1.5) - - OMGHTTPURLRQ (3.1.1): - - OMGHTTPURLRQ/RQ (= 3.1.1) - - OMGHTTPURLRQ/FormURLEncode (3.1.1) - - OMGHTTPURLRQ/RQ (3.1.1): + - OMGHTTPURLRQ (3.1.2): + - OMGHTTPURLRQ/RQ (= 3.1.2) + - OMGHTTPURLRQ/FormURLEncode (3.1.2) + - OMGHTTPURLRQ/RQ (3.1.2): - OMGHTTPURLRQ/FormURLEncode - OMGHTTPURLRQ/UserAgent - - OMGHTTPURLRQ/UserAgent (3.1.1) + - OMGHTTPURLRQ/UserAgent (3.1.2) - PetstoreClient (0.0.1): - Alamofire (~> 3.1.5) - PromiseKit (~> 3.1.1) @@ -32,7 +32,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Alamofire: 5f730ba29fd113b7ddd71c1e65d0c630acf5d7b0 - OMGHTTPURLRQ: 633f98ee745aeda02345935a52eec1784cddb589 + OMGHTTPURLRQ: 38316b56d88125c600bcdb16df8329147da2b0ee PetstoreClient: efd495da2b7a6f3e798752702d59f96e306dbace PromiseKit: 4e8127c22a9b29d1b44958ab2ec762ea6115cbfb diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/README.markdown b/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/README.markdown index ff90551787..1cd71258ad 100644 --- a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/README.markdown +++ b/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/README.markdown @@ -39,7 +39,7 @@ NSData *data2 = UIImagePNGRepresentation(image2); [multipartFormData addFile:data2 parameterName:@"file2" filename:@"myimage2.png" contentType:@"image/png"]; // SUPER Ideally you would not want to re-encode the JPEG as the process -// is lossy. If you image comes from the AssetLibrary you *CAN* get the +// is lossy. If your image comes from the AssetLibrary you *CAN* get the // original `NSData`. See stackoverflow.com. UIImage *image3 = [UIImage imageNamed:@"image3"]; NSData *data3 = UIImageJPEGRepresentation(image3); @@ -97,7 +97,7 @@ your API keys that registering at https://dev.twitter.com will provide you. ```objc -NSMutableURLRequest *rq = [TDOAuth URLRequestForPath:@"/oauth/request_token" POSTParameters:@{@"x_auth_mode" : @"reverse_auth"} host:@"api.twitter.com"consumerKey:APIKey consumerSecret:APISecret accessToken:nil tokenSecret:nil]; +NSMutableURLRequest *rq = [TDOAuth URLRequestForPath:@"/oauth/request_token" POSTParameters:@{@"x_auth_mode" : @"reverse_auth"} host:@"api.twitter.com" consumerKey:APIKey consumerSecret:APISecret accessToken:nil tokenSecret:nil]; [rq addValue:OMGUserAgent() forHTTPHeaderField:@"User-Agent"]; [NSURLConnection sendAsynchronousRequest:rq queue:nil completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { @@ -142,4 +142,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -``` \ No newline at end of file +``` diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.m b/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.m index 0854acd0eb..3f48ace500 100644 --- a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.m +++ b/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.m @@ -71,8 +71,8 @@ static inline NSMutableURLRequest *OMGMutableURLRequest() { @implementation OMGHTTPURLRQ + (NSMutableURLRequest *)GET:(NSString *)urlString :(NSDictionary *)params error:(NSError **)error { - id queryString = OMGFormURLEncode(params); - if (queryString) urlString = [urlString stringByAppendingFormat:@"?%@", queryString]; + NSString *queryString = OMGFormURLEncode(params); + if (queryString.length) urlString = [urlString stringByAppendingFormat:@"?%@", queryString]; id url = [NSURL URLWithString:urlString]; if (!url) { diff --git a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/Info.plist b/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/Info.plist index 793d31a9fd..c11c2ee42e 100644 --- a/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/Info.plist +++ b/samples/client/petstore/swift-promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 3.1.1 + 3.1.2 CFBundleSignature ???? CFBundleVersion