Merge pull request #918 from geekerzp/develop_2.0_objc_issue

[Objc] Enhancements and Issue fix
This commit is contained in:
wing328 2015-07-15 18:20:40 +08:00
commit 5c9afbafb2
106 changed files with 2058 additions and 2283 deletions

6
.gitignore vendored
View File

@ -31,8 +31,10 @@ samples/client/petstore/qt5cpp/PetStore/PetStore
samples/client/petstore/qt5cpp/PetStore/Makefile
samples/client/petstore/java/hello.txt
samples/client/petstore/android-java/hello.txt
samples/client/petstore/objc/Build
samples/client/petstore/objc/Pods
samples/client/petstore/objc/SwaggerClientTests/Build
samples/client/petstore/objc/SwaggerClientTests/Pods
samples/client/petstore/objc/SwaggerClientTests/SwaggerClient.xcworkspace
samples/client/petstore/objc/SwaggerClientTests/Podfile.lock
samples/server/petstore/nodejs/node_modules
target
.idea

View File

@ -18,43 +18,60 @@ import java.util.Set;
public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
protected Set<String> foundationClasses = new HashSet<String>();
protected String sourceFolder = "client";
protected String podName = "SwaggerClient";
protected String podVersion = "1.0.0";
protected String classPrefix = "SWG";
protected String projectName = "SwaggerClient";
public ObjcClientCodegen() {
super();
outputFolder = "generated-code" + File.separator + "objc";
modelTemplateFiles.put("model-header.mustache", ".h");
modelTemplateFiles.put("model-body.mustache", ".m");
apiTemplateFiles.put("api-header.mustache", ".h");
apiTemplateFiles.put("api-body.mustache", ".m");
templateDir = "objc";
modelPackage = "";
defaultIncludes = new HashSet<String>(
Arrays.asList(
"bool",
"BOOL",
"int",
"NSString",
"NSObject",
"NSArray",
"NSNumber",
"NSDate",
"NSDictionary",
"NSMutableArray",
"NSMutableDictionary")
);
languageSpecificPrimitives = new HashSet<String>(
Arrays.asList(
"NSNumber",
"NSString",
"NSObject",
"NSDate",
"bool",
"BOOL")
);
defaultIncludes.clear();
defaultIncludes.add("bool");
defaultIncludes.add("BOOL");
defaultIncludes.add("int");
defaultIncludes.add("NSURL");
defaultIncludes.add("NSString");
defaultIncludes.add("NSObject");
defaultIncludes.add("NSArray");
defaultIncludes.add("NSNumber");
defaultIncludes.add("NSDate");
defaultIncludes.add("NSDictionary");
defaultIncludes.add("NSMutableArray");
defaultIncludes.add("NSMutableDictionary");
languageSpecificPrimitives.clear();
languageSpecificPrimitives.add("NSNumber");
languageSpecificPrimitives.add("NSString");
languageSpecificPrimitives.add("NSObject");
languageSpecificPrimitives.add("NSDate");
languageSpecificPrimitives.add("NSURL");
languageSpecificPrimitives.add("bool");
languageSpecificPrimitives.add("BOOL");
typeMapping.clear();
typeMapping.put("enum", "NSString");
typeMapping.put("Date", "NSDate");
typeMapping.put("DateTime", "NSDate");
typeMapping.put("boolean", "NSNumber");
typeMapping.put("string", "NSString");
typeMapping.put("integer", "NSNumber");
typeMapping.put("int", "NSNumber");
typeMapping.put("float", "NSNumber");
typeMapping.put("long", "NSNumber");
typeMapping.put("double", "NSNumber");
typeMapping.put("array", "NSArray");
typeMapping.put("map", "NSDictionary");
typeMapping.put("number", "NSNumber");
typeMapping.put("List", "NSArray");
typeMapping.put("object", "NSObject");
typeMapping.put("file", "NSURL");
// ref: http://www.tutorialspoint.com/objective_c/objective_c_basic_syntax.htm
reservedWords = new HashSet<String>(
@ -70,26 +87,10 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
"double", "protocol", "interface", "implementation",
"NSObject", "NSInteger", "NSNumber", "CGFloat",
"property", "nonatomic", "retain", "strong",
"weak", "unsafe_unretained", "readwrite", "readonly"
"weak", "unsafe_unretained", "readwrite", "readonly",
"description"
));
typeMapping = new HashMap<String, String>();
typeMapping.put("enum", "NSString");
typeMapping.put("Date", "NSDate");
typeMapping.put("DateTime", "NSDate");
typeMapping.put("boolean", "BOOL");
typeMapping.put("string", "NSString");
typeMapping.put("integer", "NSNumber");
typeMapping.put("int", "NSNumber");
typeMapping.put("float", "NSNumber");
typeMapping.put("long", "NSNumber");
typeMapping.put("double", "NSNumber");
typeMapping.put("array", "NSArray");
typeMapping.put("map", "NSDictionary");
typeMapping.put("number", "NSNumber");
typeMapping.put("List", "NSArray");
typeMapping.put("object", "NSObject");
importMapping = new HashMap<String, String>();
foundationClasses = new HashSet<String>(
@ -98,15 +99,17 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
"NSObject",
"NSString",
"NSDate",
"NSURL",
"NSDictionary")
);
instantiationTypes.put("array", "NSMutableArray");
instantiationTypes.put("map", "NSMutableDictionary");
cliOptions.add(new CliOption("classPrefix", "prefix for generated classes"));
cliOptions.add(new CliOption("sourceFolder", "source folder for generated code"));
cliOptions.add(new CliOption("projectName", "name of the Xcode project in generated Podfile"));
cliOptions.clear();
cliOptions.add(new CliOption("classPrefix", "prefix for generated classes (convention: Abbreviation of pod name e.g. `HN` for `HackerNews`), default: `SWG`"));
cliOptions.add(new CliOption("podName", "cocoapods package name (convention: CameCase), default: `SwaggerClient`"));
cliOptions.add(new CliOption("podVersion", "cocoapods package version, default: `1.0.0`"));
}
public CodegenType getTag() {
@ -125,35 +128,43 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
public void processOpts() {
super.processOpts();
if (additionalProperties.containsKey("sourceFolder")) {
this.setSourceFolder((String) additionalProperties.get("sourceFolder"));
if (additionalProperties.containsKey("podName")) {
setPodName((String) additionalProperties.get("podName"));
}
if (additionalProperties.containsKey("podVersion")) {
setPodVersion((String) additionalProperties.get("podVersion"));
}
if (additionalProperties.containsKey("classPrefix")) {
this.setClassPrefix((String) additionalProperties.get("classPrefix"));
setClassPrefix((String) additionalProperties.get("classPrefix"));
}
if (additionalProperties.containsKey("projectName")) {
this.setProjectName((String) additionalProperties.get("projectName"));
} else {
additionalProperties.put("projectName", projectName);
}
additionalProperties.put("podName", podName);
additionalProperties.put("podVersion", podVersion);
additionalProperties.put("classPrefix", classPrefix);
supportingFiles.add(new SupportingFile("SWGObject.h", sourceFolder, "SWGObject.h"));
supportingFiles.add(new SupportingFile("SWGObject.m", sourceFolder, "SWGObject.m"));
supportingFiles.add(new SupportingFile("SWGQueryParamCollection.h", sourceFolder, "SWGQueryParamCollection.h"));
supportingFiles.add(new SupportingFile("SWGQueryParamCollection.m", sourceFolder, "SWGQueryParamCollection.m"));
supportingFiles.add(new SupportingFile("SWGApiClient-header.mustache", sourceFolder, "SWGApiClient.h"));
supportingFiles.add(new SupportingFile("SWGApiClient-body.mustache", sourceFolder, "SWGApiClient.m"));
supportingFiles.add(new SupportingFile("SWGJSONResponseSerializer-header.mustache", sourceFolder, "SWGJSONResponseSerializer.h"));
supportingFiles.add(new SupportingFile("SWGJSONResponseSerializer-body.mustache", sourceFolder, "SWGJSONResponseSerializer.m"));
supportingFiles.add(new SupportingFile("SWGFile.h", sourceFolder, "SWGFile.h"));
supportingFiles.add(new SupportingFile("SWGFile.m", sourceFolder, "SWGFile.m"));
supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601.m", sourceFolder, "JSONValueTransformer+ISO8601.m"));
supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601.h", sourceFolder, "JSONValueTransformer+ISO8601.h"));
supportingFiles.add(new SupportingFile("SWGConfiguration-body.mustache", sourceFolder, "SWGConfiguration.m"));
supportingFiles.add(new SupportingFile("SWGConfiguration-header.mustache", sourceFolder, "SWGConfiguration.h"));
supportingFiles.add(new SupportingFile("Podfile.mustache", "", "Podfile"));
String swaggerFolder = podName;
modelPackage = swaggerFolder;
apiPackage = swaggerFolder;
supportingFiles.add(new SupportingFile("Object-header.mustache", swaggerFolder, classPrefix + "Object.h"));
supportingFiles.add(new SupportingFile("Object-body.mustache", swaggerFolder, classPrefix + "Object.m"));
supportingFiles.add(new SupportingFile("QueryParamCollection-header.mustache", swaggerFolder, classPrefix + "QueryParamCollection.h"));
supportingFiles.add(new SupportingFile("QueryParamCollection-body.mustache", swaggerFolder, classPrefix + "QueryParamCollection.m"));
supportingFiles.add(new SupportingFile("ApiClient-header.mustache", swaggerFolder, classPrefix + "ApiClient.h"));
supportingFiles.add(new SupportingFile("ApiClient-body.mustache", swaggerFolder, classPrefix + "ApiClient.m"));
supportingFiles.add(new SupportingFile("JSONResponseSerializer-header.mustache", swaggerFolder, classPrefix + "JSONResponseSerializer.h"));
supportingFiles.add(new SupportingFile("JSONResponseSerializer-body.mustache", swaggerFolder, classPrefix + "JSONResponseSerializer.m"));
supportingFiles.add(new SupportingFile("JSONRequestSerializer-body.mustache", swaggerFolder, classPrefix + "JSONRequestSerializer.m"));
supportingFiles.add(new SupportingFile("JSONRequestSerializer-header.mustache", swaggerFolder, classPrefix + "JSONRequestSerializer.h"));
supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601.m", swaggerFolder, "JSONValueTransformer+ISO8601.m"));
supportingFiles.add(new SupportingFile("JSONValueTransformer+ISO8601.h", swaggerFolder, "JSONValueTransformer+ISO8601.h"));
supportingFiles.add(new SupportingFile("Configuration-body.mustache", swaggerFolder, classPrefix + "Configuration.m"));
supportingFiles.add(new SupportingFile("Configuration-header.mustache", swaggerFolder, classPrefix + "Configuration.h"));
supportingFiles.add(new SupportingFile("podspec.mustache", "", podName + ".podspec"));
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
}
@Override
@ -285,11 +296,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
@Override
public String toModelImport(String name) {
if ("".equals(modelPackage())) {
return name;
} else {
return modelPackage() + "." + name;
}
return name;
}
@Override
@ -299,12 +306,12 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
@Override
public String apiFileFolder() {
return outputFolder + File.separator + sourceFolder;
return outputFolder + File.separatorChar + apiPackage();
}
@Override
public String modelFileFolder() {
return outputFolder + File.separator + sourceFolder;
return outputFolder + File.separatorChar + modelPackage();
}
@Override
@ -359,15 +366,15 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
return camelize(operationId, true);
}
public void setSourceFolder(String sourceFolder) {
this.sourceFolder = sourceFolder;
}
public void setClassPrefix(String classPrefix) {
this.classPrefix = classPrefix;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
public void setPodName(String podName) {
this.podName = podName;
}
public void setPodVersion(String podVersion) {
this.podVersion = podVersion;
}
}

View File

@ -1,11 +1,8 @@
#import "SWGApiClient.h"
#import "SWGFile.h"
#import "SWGQueryParamCollection.h"
#import "SWGConfiguration.h"
#import "{{classPrefix}}ApiClient.h"
@implementation SWGApiClient
@implementation {{classPrefix}}ApiClient
NSString *const SWGResponseObjectErrorKey = @"SWGResponseObject";
NSString *const {{classPrefix}}ResponseObjectErrorKey = @"{{classPrefix}}ResponseObject";
static long requestId = 0;
static bool offlineState = false;
@ -14,31 +11,38 @@ static bool cacheEnabled = false;
static AFNetworkReachabilityStatus reachabilityStatus = AFNetworkReachabilityStatusNotReachable;
static NSOperationQueue* sharedQueue;
static void (^reachabilityChangeBlock)(int);
static bool loggingEnabled = true;
#pragma mark - Log Methods
+(void)setLoggingEnabled:(bool) state {
loggingEnabled = state;
- (void)logResponse:(AFHTTPRequestOperation *)operation
forRequest:(NSURLRequest *)request
error:(NSError*)error {
{{classPrefix}}Configuration *config = [{{classPrefix}}Configuration sharedConfig];
NSString *message = [NSString stringWithFormat:@"\n[DEBUG] Request body \n~BEGIN~\n %@\n~END~\n"\
"[DEBUG] HTTP Response body \n~BEGIN~\n %@\n~END~\n",
[[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding],
operation.responseString];
if (config.loggingFileHanlder) {
[config.loggingFileHanlder seekToEndOfFile];
[config.loggingFileHanlder writeData:[message dataUsingEncoding:NSUTF8StringEncoding]];
}
NSLog(@"%@", message);
}
- (void)logRequest:(NSURLRequest*)request {
NSLog(@"request: %@", [self descriptionForRequest:request]);
}
#pragma mark - Cache Methods
- (void)logResponse:(id)data forRequest:(NSURLRequest*)request error:(NSError*)error {
NSLog(@"request: %@ response: %@ ", [self descriptionForRequest:request], data );
+ (void) setCacheEnabled:(BOOL)enabled {
cacheEnabled = enabled;
}
#pragma mark -
+(void)clearCache {
[[NSURLCache sharedURLCache] removeAllCachedResponses];
}
+(void)setCacheEnabled:(BOOL)enabled {
cacheEnabled = enabled;
}
#pragma mark -
+(void)configureCacheWithMemoryAndDiskCapacity: (unsigned long) memorySize
diskSize: (unsigned long) diskSize {
@ -58,7 +62,7 @@ static bool loggingEnabled = true;
return sharedQueue;
}
+(SWGApiClient *)sharedClientFromPool:(NSString *)baseUrl {
+({{classPrefix}}ApiClient *)sharedClientFromPool:(NSString *)baseUrl {
static NSMutableDictionary *_pool = nil;
if (queuedRequests == nil) {
queuedRequests = [[NSMutableSet alloc]init];
@ -72,21 +76,21 @@ static bool loggingEnabled = true;
_pool = [[NSMutableDictionary alloc] init];
// initialize URL cache
[SWGApiClient configureCacheWithMemoryAndDiskCapacity:4*1024*1024 diskSize:32*1024*1024];
[{{classPrefix}}ApiClient configureCacheWithMemoryAndDiskCapacity:4*1024*1024 diskSize:32*1024*1024];
// configure reachability
[SWGApiClient configureCacheReachibilityForHost:baseUrl];
[{{classPrefix}}ApiClient configureCacheReachibilityForHost:baseUrl];
}
@synchronized(self) {
SWGApiClient * client = [_pool objectForKey:baseUrl];
{{classPrefix}}ApiClient * client = [_pool objectForKey:baseUrl];
if (client == nil) {
client = [[SWGApiClient alloc] initWithBaseURL:[NSURL URLWithString:baseUrl]];
client = [[{{classPrefix}}ApiClient alloc] initWithBaseURL:[NSURL URLWithString:baseUrl]];
[_pool setValue:client forKey:baseUrl ];
if(loggingEnabled)
if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"new client for path %@", baseUrl);
}
if(loggingEnabled)
if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"returning client for path %@", baseUrl);
return client;
}
@ -149,15 +153,15 @@ static bool loggingEnabled = true;
+(NSNumber*) nextRequestId {
@synchronized(self) {
long nextId = ++requestId;
if(loggingEnabled)
if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"got id %ld", nextId);
return [NSNumber numberWithLong:nextId];
}
}
+(NSNumber*) queueRequest {
NSNumber* requestId = [SWGApiClient nextRequestId];
if(loggingEnabled)
NSNumber* requestId = [{{classPrefix}}ApiClient nextRequestId];
if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"added %@ to request queue", requestId);
[queuedRequests addObject:requestId];
return requestId;
@ -190,7 +194,7 @@ static bool loggingEnabled = true;
}];
if(matchingItems.count == 1) {
if(loggingEnabled)
if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"removing request id %@", requestId);
[queuedRequests removeObject:requestId];
return true;
@ -221,31 +225,31 @@ static bool loggingEnabled = true;
}
+(void) configureCacheReachibilityForHost:(NSString*)host {
[[SWGApiClient sharedClientFromPool:host].reachabilityManager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
[[{{classPrefix}}ApiClient sharedClientFromPool:host].reachabilityManager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
reachabilityStatus = status;
switch (status) {
case AFNetworkReachabilityStatusUnknown:
if(loggingEnabled)
if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"reachability changed to AFNetworkReachabilityStatusUnknown");
[SWGApiClient setOfflineState:true];
[{{classPrefix}}ApiClient setOfflineState:true];
break;
case AFNetworkReachabilityStatusNotReachable:
if(loggingEnabled)
if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"reachability changed to AFNetworkReachabilityStatusNotReachable");
[SWGApiClient setOfflineState:true];
[{{classPrefix}}ApiClient setOfflineState:true];
break;
case AFNetworkReachabilityStatusReachableViaWWAN:
if(loggingEnabled)
if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"reachability changed to AFNetworkReachabilityStatusReachableViaWWAN");
[SWGApiClient setOfflineState:false];
[{{classPrefix}}ApiClient setOfflineState:false];
break;
case AFNetworkReachabilityStatusReachableViaWiFi:
if(loggingEnabled)
if([[{{classPrefix}}Configuration sharedConfig] debug])
NSLog(@"reachability changed to AFNetworkReachabilityStatusReachableViaWiFi");
[SWGApiClient setOfflineState:false];
[{{classPrefix}}ApiClient setOfflineState:false];
break;
default:
break;
@ -255,7 +259,7 @@ static bool loggingEnabled = true;
reachabilityChangeBlock(status);
}
}];
[[SWGApiClient sharedClientFromPool:host].reachabilityManager startMonitoring];
[[{{classPrefix}}ApiClient sharedClientFromPool:host].reachabilityManager startMonitoring];
}
-(NSString*) pathWithQueryParamsToString:(NSString*) path
@ -268,36 +272,35 @@ static bool loggingEnabled = true;
for(NSString * key in [queryParams keyEnumerator]){
if(counter == 0) separator = @"?";
else separator = @"&";
NSString * value;
id queryParam = [queryParams valueForKey:key];
if([queryParam isKindOfClass:[NSString class]]){
[requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator,
[SWGApiClient escape:key], [SWGApiClient escape:[queryParams valueForKey:key]]]];
[{{classPrefix}}ApiClient escape:key], [{{classPrefix}}ApiClient escape:[queryParams valueForKey:key]]]];
}
else if([queryParam isKindOfClass:[SWGQueryParamCollection class]]){
SWGQueryParamCollection * coll = (SWGQueryParamCollection*) queryParam;
else if([queryParam isKindOfClass:[{{classPrefix}}QueryParamCollection class]]){
{{classPrefix}}QueryParamCollection * coll = ({{classPrefix}}QueryParamCollection*) queryParam;
NSArray* values = [coll values];
NSString* format = [coll format];
if([format isEqualToString:@"csv"]) {
[requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator,
[SWGApiClient escape:key], [NSString stringWithFormat:@"%@", [values componentsJoinedByString:@","]]]];
[{{classPrefix}}ApiClient escape:key], [NSString stringWithFormat:@"%@", [values componentsJoinedByString:@","]]]];
}
else if([format isEqualToString:@"tsv"]) {
[requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator,
[SWGApiClient escape:key], [NSString stringWithFormat:@"%@", [values componentsJoinedByString:@"\t"]]]];
[{{classPrefix}}ApiClient escape:key], [NSString stringWithFormat:@"%@", [values componentsJoinedByString:@"\t"]]]];
}
else if([format isEqualToString:@"pipes"]) {
[requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator,
[SWGApiClient escape:key], [NSString stringWithFormat:@"%@", [values componentsJoinedByString:@"|"]]]];
[{{classPrefix}}ApiClient escape:key], [NSString stringWithFormat:@"%@", [values componentsJoinedByString:@"|"]]]];
}
else if([format isEqualToString:@"multi"]) {
for(id obj in values) {
[requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator,
[SWGApiClient escape:key], [NSString stringWithFormat:@"%@", obj]]];
[{{classPrefix}}ApiClient escape:key], [NSString stringWithFormat:@"%@", obj]]];
counter += 1;
}
@ -305,7 +308,7 @@ static bool loggingEnabled = true;
}
else {
[requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator,
[SWGApiClient escape:key], [NSString stringWithFormat:@"%@", [queryParams valueForKey:key]]]];
[{{classPrefix}}ApiClient escape:key], [NSString stringWithFormat:@"%@", [queryParams valueForKey:key]]]];
}
counter += 1;
@ -314,11 +317,6 @@ static bool loggingEnabled = true;
return requestUrl;
}
- (NSString*)descriptionForRequest:(NSURLRequest*)request {
return [[request URL] absoluteString];
}
/**
* Update header and query params based on authentication settings
*/
@ -333,7 +331,7 @@ static bool loggingEnabled = true;
NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers];
NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys];
SWGConfiguration *config = [SWGConfiguration sharedConfig];
{{classPrefix}}Configuration *config = [{{classPrefix}}Configuration sharedConfig];
for (NSString *auth in authSettings) {
NSDictionary *authSetting = [[config authSettings] objectForKey:auth];
@ -359,8 +357,8 @@ static bool loggingEnabled = true;
NSMutableArray *resultArray = nil;
NSMutableDictionary *resultDict = nil;
// return nil if data is nil
if (!data) {
// return nil if data is nil or class is nil
if (!data || !class) {
return nil;
}
@ -473,20 +471,112 @@ static bool loggingEnabled = true;
return nil;
}
#pragma mark - Operation Methods
- (void) operationWithCompletionBlock: (NSURLRequest *)request
requestId: (NSNumber *) requestId
completionBlock: (void (^)(id, NSError *))completionBlock {
AFHTTPRequestOperation *op = [self HTTPRequestOperationWithRequest:request
success:^(AFHTTPRequestOperation *operation, id response) {
if([self executeRequestWithId:requestId]) {
if([[{{classPrefix}}Configuration sharedConfig] debug]) {
[self logResponse:operation forRequest:request error:nil];
}
completionBlock(response, nil);
}
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
if([self executeRequestWithId:requestId]) {
NSMutableDictionary *userInfo = [error.userInfo mutableCopy];
if(operation.responseObject) {
// Add in the (parsed) response body.
userInfo[{{classPrefix}}ResponseObjectErrorKey] = operation.responseObject;
}
NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo];
if([[{{classPrefix}}Configuration sharedConfig] debug])
[self logResponse:nil forRequest:request error:augmentedError];
completionBlock(nil, augmentedError);
}
}];
[self.operationQueue addOperation:op];
}
- (void) downloadOperationWithCompletionBlock: (NSURLRequest *)request
requestId: (NSNumber *) requestId
completionBlock: (void (^)(id, NSError *))completionBlock {
AFHTTPRequestOperation *op = [self HTTPRequestOperationWithRequest:request
success:^(AFHTTPRequestOperation *operation, id responseObject) {
{{classPrefix}}Configuration *config = [{{classPrefix}}Configuration sharedConfig];
NSString *directory = nil;
if (config.tempFolderPath) {
directory = config.tempFolderPath;
}
else {
directory = NSTemporaryDirectory();
}
NSDictionary *headers = operation.response.allHeaderFields;
NSString *filename = nil;
if ([headers objectForKey:@"Content-Disposition"]) {
NSString *pattern = @"filename=['\"]?([^'\"\\s]+)['\"]?";
NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:pattern
options:NSRegularExpressionCaseInsensitive
error:nil];
NSString *contentDispositionHeader = [headers objectForKey:@"Content-Disposition"];
NSTextCheckingResult *match = [regexp firstMatchInString:contentDispositionHeader
options:0
range:NSMakeRange(0, [contentDispositionHeader length])];
filename = [contentDispositionHeader substringWithRange:[match rangeAtIndex:1]];
}
else {
filename = [NSString stringWithFormat:@"%@", [[NSProcessInfo processInfo] globallyUniqueString]];
}
NSString *filepath = [directory stringByAppendingPathComponent:filename];
NSURL *file = [NSURL fileURLWithPath:filepath];
[operation.responseData writeToURL:file atomically:YES];
completionBlock(file, nil);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
if ([self executeRequestWithId:requestId]) {
NSMutableDictionary *userInfo = [error.userInfo mutableCopy];
if (operation.responseObject) {
userInfo[{{classPrefix}}ResponseObjectErrorKey] = operation.responseObject;
}
NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo];
if ([[{{classPrefix}}Configuration sharedConfig] debug]) {
[self logResponse:nil forRequest:request error:augmentedError];
}
completionBlock(nil, augmentedError);
}
}];
[self.operationQueue addOperation:op];
}
#pragma mark - Perform Request Methods
-(NSNumber*) requestWithCompletionBlock: (NSString*) path
method: (NSString*) method
queryParams: (NSDictionary*) queryParams
formParams: (NSDictionary *) formParams
files: (NSDictionary *) files
body: (id) body
headerParams: (NSDictionary*) headerParams
authSettings: (NSArray *) authSettings
requestContentType: (NSString*) requestContentType
responseContentType: (NSString*) responseContentType
responseType: (NSString *) responseType
completionBlock: (void (^)(id, NSError *))completionBlock {
// setting request serializer
if ([requestContentType isEqualToString:@"application/json"]) {
self.requestSerializer = [AFJSONRequestSerializer serializer];
self.requestSerializer = [{{classPrefix}}JSONRequestSerializer serializer];
}
else if ([requestContentType isEqualToString:@"application/x-www-form-urlencoded"]) {
self.requestSerializer = [AFHTTPRequestSerializer serializer];
@ -500,7 +590,7 @@ static bool loggingEnabled = true;
// setting response serializer
if ([responseContentType isEqualToString:@"application/json"]) {
self.responseSerializer = [SWGJSONResponseSerializer serializer];
self.responseSerializer = [{{classPrefix}}JSONResponseSerializer serializer];
}
else {
self.responseSerializer = [AFHTTPResponseSerializer serializer];
@ -510,68 +600,42 @@ static bool loggingEnabled = true;
[self updateHeaderParams:&headerParams queryParams:&queryParams WithAuthSettings:authSettings];
NSMutableURLRequest * request = nil;
if (body != nil && [body isKindOfClass:[NSArray class]]){
SWGFile * file;
NSMutableDictionary * params = [[NSMutableDictionary alloc] init];
for(id obj in body) {
if([obj isKindOfClass:[SWGFile class]]) {
file = (SWGFile*) obj;
requestContentType = @"multipart/form-data";
}
else if([obj isKindOfClass:[NSDictionary class]]) {
for(NSString * key in obj) {
params[key] = obj[key];
}
}
}
NSString * urlString = [[NSURL URLWithString:path relativeToURL:self.baseURL] absoluteString];
// request with multipart form
if([requestContentType isEqualToString:@"multipart/form-data"]) {
request = [self.requestSerializer multipartFormRequestWithMethod: @"POST"
URLString: urlString
parameters: nil
constructingBodyWithBlock: ^(id<AFMultipartFormData> formData) {
for(NSString * key in params) {
NSData* data = [params[key] dataUsingEncoding:NSUTF8StringEncoding];
[formData appendPartWithFormData: data name: key];
}
if (file) {
[formData appendPartWithFileData: [file data]
name: [file paramName]
fileName: [file name]
mimeType: [file mimeType]];
}
}
error:nil];
}
// request with form parameters or json
else {
NSString* pathWithQueryParams = [self pathWithQueryParamsToString:path queryParams:queryParams];
NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString];
request = [self.requestSerializer requestWithMethod:method
URLString:urlString
parameters:params
error:nil];
}
NSString* pathWithQueryParams = [self pathWithQueryParamsToString:path queryParams:queryParams];
NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString];
if (files.count > 0) {
request = [self.requestSerializer multipartFormRequestWithMethod:@"POST"
URLString:urlString
parameters:nil
constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
[formParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
NSData *data = [obj dataUsingEncoding:NSUTF8StringEncoding];
[formData appendPartWithFormData:data name:key];
}];
[files enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
NSURL *filePath = (NSURL *)obj;
[formData appendPartWithFileURL:filePath name:key error:nil];
}];
} error:nil];
}
else {
NSString * pathWithQueryParams = [self pathWithQueryParamsToString:path queryParams:queryParams];
NSString * urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString];
request = [self.requestSerializer requestWithMethod: method
URLString: urlString
parameters: body
error: nil];
if (formParams) {
request = [self.requestSerializer requestWithMethod:method
URLString:urlString
parameters:formParams
error:nil];
}
if (body) {
request = [self.requestSerializer requestWithMethod:method
URLString:urlString
parameters:body
error:nil];
}
}
BOOL hasHeaderParams = false;
if(headerParams != nil && [headerParams count] > 0)
if(headerParams != nil && [headerParams count] > 0) {
hasHeaderParams = true;
}
if(offlineState) {
NSLog(@"%@ cache forced", path);
[request setCachePolicy:NSURLRequestReturnCacheDataDontLoad];
@ -585,17 +649,7 @@ static bool loggingEnabled = true;
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
}
if(body != nil) {
if([body isKindOfClass:[NSDictionary class]] || [body isKindOfClass:[NSArray class]]){
[self.requestSerializer setValue:requestContentType forHTTPHeaderField:@"Content-Type"];
}
else if ([body isKindOfClass:[SWGFile class]]){}
else {
NSAssert(false, @"unsupported post type!");
}
}
if(headerParams != nil){
if(hasHeaderParams){
for(NSString * key in [headerParams keyEnumerator]){
[request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key];
}
@ -606,31 +660,17 @@ static bool loggingEnabled = true;
// Always disable cookies!
[request setHTTPShouldHandleCookies:NO];
NSNumber* requestId = [SWGApiClient queueRequest];
AFHTTPRequestOperation *op = [self HTTPRequestOperationWithRequest:request
success:^(AFHTTPRequestOperation *operation, id response) {
if([self executeRequestWithId:requestId]) {
if(self.logServerResponses) {
[self logResponse:response forRequest:request error:nil];
}
completionBlock(response, nil);
}
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
if([self executeRequestWithId:requestId]) {
NSMutableDictionary *userInfo = [error.userInfo mutableCopy];
if(operation.responseObject) {
// Add in the (parsed) response body.
userInfo[SWGResponseObjectErrorKey] = operation.responseObject;
}
NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo];
if(self.logServerResponses)
[self logResponse:nil forRequest:request error:augmentedError];
completionBlock(nil, augmentedError);
}
}];
[self.operationQueue addOperation:op];
NSNumber* requestId = [{{classPrefix}}ApiClient queueRequest];
if ([responseType isEqualToString:@"NSURL*"]) {
[self downloadOperationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) {
completionBlock(data, error);
}];
}
else {
[self operationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) {
completionBlock([self deserialize:data class:responseType], error);
}];
}
return requestId;
}
@ -639,8 +679,3 @@ static bool loggingEnabled = true;

View File

@ -1,7 +1,11 @@
#import <Foundation/Foundation.h>
#import <ISO8601/ISO8601.h>
#import "AFHTTPRequestOperationManager.h"
#import "SWGJSONResponseSerializer.h"
#import <AFNetworking/AFHTTPRequestOperationManager.h>
#import "{{classPrefix}}JSONResponseSerializer.h"
#import "{{classPrefix}}JSONRequestSerializer.h"
#import "{{classPrefix}}QueryParamCollection.h"
#import "{{classPrefix}}Configuration.h"
{{#models}}{{#model}}#import "{{classname}}.h"
{{/model}}{{/models}}
@ -11,18 +15,13 @@
*
* The corresponding value is the parsed response body for an HTTP error.
*/
extern NSString *const SWGResponseObjectErrorKey;
extern NSString *const {{classPrefix}}ResponseObjectErrorKey;
@interface SWGApiClient : AFHTTPRequestOperationManager
@interface {{classPrefix}}ApiClient : AFHTTPRequestOperationManager
@property(nonatomic, assign) NSURLRequestCachePolicy cachePolicy;
@property(nonatomic, assign) NSTimeInterval timeoutInterval;
@property(nonatomic, assign) BOOL logRequests;
@property(nonatomic, assign) BOOL logCacheHits;
@property(nonatomic, assign) BOOL logServerResponses;
@property(nonatomic, assign) BOOL logJSON;
@property(nonatomic, assign) BOOL logHTTP;
@property(nonatomic, readonly) NSOperationQueue* queue;
/**
@ -30,9 +29,9 @@ extern NSString *const SWGResponseObjectErrorKey;
*
* @param baseUrl The base url of api client.
*
* @return The SWGApiClient instance.
* @return The {{classPrefix}}ApiClient instance.
*/
+(SWGApiClient *)sharedClientFromPool:(NSString *)baseUrl;
+({{classPrefix}}ApiClient *)sharedClientFromPool:(NSString *)baseUrl;
/**
* Get the operations queue
@ -41,13 +40,6 @@ extern NSString *const SWGResponseObjectErrorKey;
*/
+(NSOperationQueue*) sharedQueue;
/**
* Turn on logging
*
* @param state logging state, must be `YES` or `NO`
*/
+(void)setLoggingEnabled:(bool) state;
/**
* Clear Cache
*/
@ -121,7 +113,7 @@ extern NSString *const SWGResponseObjectErrorKey;
/**
* Set the client reachability strategy
*
* @param host The host of SWGApiClient.
* @param host The host of {{classPrefix}}ApiClient.
*/
+(void) configureCacheReachibilityForHost:(NSString*)host;
@ -171,6 +163,17 @@ extern NSString *const SWGResponseObjectErrorKey;
*/
- (id) deserialize:(id) data class:(NSString *) class;
/**
* Logging request and response
*
* @param operation AFHTTPRequestOperation for the HTTP request.
* @param request The HTTP request.
* @param error The error of the HTTP request.
*/
- (void)logResponse:(AFHTTPRequestOperation *)operation
forRequest:(NSURLRequest *)request
error:(NSError *)error;
/**
* Perform request
*
@ -189,15 +192,14 @@ extern NSString *const SWGResponseObjectErrorKey;
-(NSNumber*) requestWithCompletionBlock:(NSString*) path
method:(NSString*) method
queryParams:(NSDictionary*) queryParams
formParams:(NSDictionary *) formParams
files:(NSDictionary *) files
body:(id) body
headerParams:(NSDictionary*) headerParams
authSettings: (NSArray *) authSettings
requestContentType:(NSString*) requestContentType
responseContentType:(NSString*) responseContentType
responseType:(NSString *) responseType
completionBlock:(void (^)(id, NSError *))completionBlock;
@end

View File

@ -1,18 +1,18 @@
#import "SWGConfiguration.h"
#import "{{classPrefix}}Configuration.h"
@interface SWGConfiguration ()
@interface {{classPrefix}}Configuration ()
@property (readwrite, nonatomic, strong) NSMutableDictionary *mutableApiKey;
@property (readwrite, nonatomic, strong) NSMutableDictionary *mutableApiKeyPrefix;
@end
@implementation SWGConfiguration
@implementation {{classPrefix}}Configuration
#pragma mark - Singletion Methods
+ (instancetype) sharedConfig {
static SWGConfiguration *shardConfig = nil;
static {{classPrefix}}Configuration *shardConfig = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
shardConfig = [[self alloc] init];
@ -27,6 +27,9 @@
if (self) {
self.username = @"";
self.password = @"";
self.tempFolderPath = nil;
self.debug = NO;
self.loggingFile = nil;
self.mutableApiKey = [NSMutableDictionary dictionary];
self.mutableApiKeyPrefix = [NSMutableDictionary dictionary];
}
@ -65,6 +68,20 @@
[self.mutableApiKeyPrefix setValue:value forKey:field];
}
- (void) setLoggingFile:(NSString *)loggingFile {
// close old file handler
if ([self.loggingFileHanlder isKindOfClass:[NSFileHandle class]]) {
[self.loggingFileHanlder closeFile];
}
_loggingFile = loggingFile;
self.loggingFileHanlder = [NSFileHandle fileHandleForWritingAtPath:_loggingFile];
if (self.loggingFileHanlder == nil) {
[[NSFileManager defaultManager] createFileAtPath:_loggingFile contents:nil attributes:nil];
self.loggingFileHanlder = [NSFileHandle fileHandleForWritingAtPath:_loggingFile];
}
}
#pragma mark - Getter Methods
- (NSDictionary *) apiKey {
@ -78,21 +95,14 @@
#pragma mark -
- (NSDictionary *) authSettings {
return @{ {{#authMethods}}{{#isApiKey}}
@"{{name}}": @{
return @{
@"api_key": @{
@"type": @"api_key",
@"in": {{#isKeyInHeader}}@"header"{{/isKeyInHeader}}{{#isKeyInQuery}}@"query"{{/isKeyInQuery}},
@"key": @"{{keyParamName}}",
@"value": [self getApiKeyWithPrefix:@"{{keyParamName}}"]
},
{{/isApiKey}}{{#isBasic}}
@"{{name}}": @{
@"type": @"basic",
@"in": @"header",
@"key": @"Authorization",
@"value": [self getBasicAuthToken]
@"key": @"api_key",
@"value": [self getApiKeyWithPrefix:@"api_key"]
},
{{/isBasic}}{{/authMethods}}
};
}

View File

@ -1,6 +1,6 @@
#import <Foundation/Foundation.h>
@interface SWGConfiguration : NSObject
@interface {{classPrefix}}Configuration : NSObject
/**
@ -23,6 +23,18 @@
@property (nonatomic) NSString *username;
@property (nonatomic) NSString *password;
/**
* Temp folder for file download
*/
@property (nonatomic) NSString *tempFolderPath;
/**
* Logging Settings
*/
@property (nonatomic) BOOL debug;
@property (nonatomic) NSString *loggingFile;
@property (nonatomic) NSFileHandle *loggingFileHanlder;
/**
* Get configuration singleton instance
*/

View File

@ -0,0 +1,35 @@
#import "{{classPrefix}}JSONRequestSerializer.h"
@implementation {{classPrefix}}JSONRequestSerializer
///
/// When customize a request serializer,
/// the serializer must conform the protocol `AFURLRequestSerialization`
/// and implements the protocol method `requestBySerializingRequest:withParameters:error:`
///
/// @param request The original request.
/// @param parameters The parameters to be encoded.
/// @param error The error that occurred while attempting to encode the request parameters.
///
/// @return A serialized request.
///
- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request
withParameters:(id)parameters
error:(NSError *__autoreleasing *)error
{
// If the body data which will be serialized isn't NSArray or NSDictionary
// then put the data in the http request body directly.
if ([parameters isKindOfClass:[NSArray class]] || [parameters isKindOfClass:[NSDictionary class]]) {
return [super requestBySerializingRequest:request withParameters:parameters error:error];
} else {
NSMutableURLRequest *mutableRequest = [request mutableCopy];
if (parameters) {
[mutableRequest setHTTPBody:[parameters dataUsingEncoding:self.stringEncoding]];
}
return mutableRequest;
}
}
@end

View File

@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
#import <AFNetworking/AFURLRequestSerialization.h>
@interface {{classPrefix}}JSONRequestSerializer : AFJSONRequestSerializer
@end

View File

@ -1,4 +1,4 @@
#import "SWGJSONResponseSerializer.h"
#import "{{classPrefix}}JSONResponseSerializer.h"
static BOOL JSONParseError(NSError *error) {
if ([error.domain isEqualToString:NSCocoaErrorDomain] && error.code == 3840) {
@ -8,7 +8,7 @@ static BOOL JSONParseError(NSError *error) {
return NO;
}
@implementation SWGJSONResponseSerializer
@implementation {{classPrefix}}JSONResponseSerializer
///
/// When customize a response serializer,

View File

@ -1,6 +1,6 @@
#import <Foundation/Foundation.h>
#import <AFNetworking/AFURLResponseSerialization.h>
@interface SWGJSONResponseSerializer : AFJSONResponseSerializer
@interface {{classPrefix}}JSONResponseSerializer : AFJSONResponseSerializer
@end

View File

@ -0,0 +1,4 @@
#import "{{classPrefix}}Object.h"
@implementation {{classPrefix}}Object
@end

View File

@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
#import <JSONModel/JSONModel.h>
@interface {{classPrefix}}Object : JSONModel
@end

View File

@ -1,5 +0,0 @@
platform :ios, '6.0'
xcodeproj '{{projectName}}/{{projectName}}.xcodeproj'
pod 'AFNetworking', '~> 2.1'
pod 'JSONModel', '~> 1.0'
pod 'ISO8601'

View File

@ -1,6 +1,6 @@
#import "SWGQueryParamCollection.h"
#import "{{classPrefix}}QueryParamCollection.h"
@implementation SWGQueryParamCollection
@implementation {{classPrefix}}QueryParamCollection
@synthesize values = _values;
@synthesize format = _format;

View File

@ -1,6 +1,6 @@
#import <Foundation/Foundation.h>
@interface SWGQueryParamCollection : NSObject
@interface {{classPrefix}}QueryParamCollection : NSObject
@property(nonatomic, readonly) NSArray* values;
@property(nonatomic, readonly) NSString* format;

View File

@ -0,0 +1,19 @@
# {{podName}}
## Requirements
The API client library requires ARC (Automatic Reference Counting) to be enabled in your Xcode project.
## Installation
To install it, put the API client library in your project and then simply add the following line to your Podfile:
```ruby
pod "{{podName}}", :path => "/path/to/lib"
```
## Author
{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
{{/hasMore}}{{/apis}}{{/apiInfo}}

View File

@ -1,14 +0,0 @@
#import <Foundation/Foundation.h>
@interface SWGFile : NSObject
@property(nonatomic, readonly) NSString* name;
@property(nonatomic, readonly) NSString* mimeType;
@property(nonatomic, readonly) NSData* data;
@property(nonatomic) NSString* paramName;
- (id) initWithNameData: (NSString*) filename
mimeType: (NSString*) mimeType
data: (NSData*) data;
@end

View File

@ -1,26 +0,0 @@
#import "SWGFile.h"
@implementation SWGFile
@synthesize name = _name;
@synthesize mimeType = _mimeType;
@synthesize data = _data;
- (id) init {
self = [super init];
return self;
}
- (id) initWithNameData: (NSString*) filename
mimeType: (NSString*) fileMimeType
data: (NSData*) data {
self = [super init];
if(self) {
_name = filename;
_mimeType = fileMimeType;
_data = data;
}
return self;
}
@end

View File

@ -1,7 +1,6 @@
{{#operations}}
#import "{{classname}}.h"
#import "SWGFile.h"
#import "SWGQueryParamCollection.h"
#import "{{classPrefix}}QueryParamCollection.h"
{{#imports}}#import "{{import}}.h"
{{/imports}}
{{newline}}
@ -19,20 +18,20 @@ static NSString * basePath = @"{{basePath}}";
- (id) init {
self = [super init];
if (self) {
self.apiClient = [SWGApiClient sharedClientFromPool:basePath];
self.apiClient = [{{classPrefix}}ApiClient sharedClientFromPool:basePath];
self.defaultHeaders = [NSMutableDictionary dictionary];
}
return self;
}
- (id) initWithApiClient:(SWGApiClient *)apiClient {
- (id) initWithApiClient:({{classPrefix}}ApiClient *)apiClient {
self = [super init];
if (self) {
if (apiClient) {
self.apiClient = apiClient;
}
else {
self.apiClient = [SWGApiClient sharedClientFromPool:basePath];
self.apiClient = [{{classPrefix}}ApiClient sharedClientFromPool:basePath];
}
self.defaultHeaders = [NSMutableDictionary dictionary];
}
@ -69,7 +68,7 @@ static NSString * basePath = @"{{basePath}}";
}
-(unsigned long) requestQueueSize {
return [SWGApiClient requestQueueSize];
return [{{classPrefix}}ApiClient requestQueueSize];
}
#pragma mark - Api Methods
@ -84,12 +83,14 @@ static NSString * basePath = @"{{basePath}}";
///
-(NSNumber*) {{nickname}}WithCompletionBlock{{^allParams}}: {{/allParams}}{{#allParams}}{{#secondaryParam}} {{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}}
{{/allParams}}
{{#returnBaseType}}{{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{{returnType}}} output, NSError* error))completionBlock{{/returnBaseType}}
{{^returnBaseType}}{{#hasParams}}completionHandler: {{/hasParams}}(void (^)(NSError* error))completionBlock{{/returnBaseType}} {
{{#returnBaseType}}{{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{{returnType}}} output, NSError* error))completionBlock { {{/returnBaseType}}
{{^returnBaseType}}{{#hasParams}}completionHandler: {{/hasParams}}(void (^)(NSError* error))completionBlock { {{/returnBaseType}}
{{#allParams}}{{#required}}
// verify the required parameter '{{paramName}}' is set
NSAssert({{paramName}} != nil, @"Missing the required parameter `{{paramName}}` when calling {{nickname}}");
if ({{paramName}} == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `{{paramName}}` when calling `{{nickname}}`"];
}
{{/required}}{{/allParams}}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@{{path}}", basePath];
@ -98,13 +99,13 @@ static NSString * basePath = @"{{basePath}}";
if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound)
[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"];
{{#pathParams}}[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"{{baseName}}", @"}"]] withString: [SWGApiClient escape:{{paramName}}]];
{{#pathParams}}[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"{{baseName}}", @"}"]] withString: [{{classPrefix}}ApiClient escape:{{paramName}}]];
{{/pathParams}}
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
{{#queryParams}}if({{paramName}} != nil) {
{{#collectionFormat}}
queryParams[@"{{baseName}}"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: {{baseName}} format: @"{{collectionFormat}}"];
queryParams[@"{{baseName}}"] = [[{{classPrefix}}QueryParamCollection alloc] initWithValuesAndFormat: {{baseName}} format: @"{{collectionFormat}}"];
{{/collectionFormat}}
{{^collectionFormat}}queryParams[@"{{baseName}}"] = {{paramName}};{{/collectionFormat}}
}
@ -114,9 +115,9 @@ static NSString * basePath = @"{{basePath}}";
{{#headerParams}}if({{paramName}} != nil)
headerParams[@"{{baseName}}"] = {{paramName}};
{{/headerParams}}
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[{{#produces}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}]];
// HTTP header `Accept`
headerParams[@"Accept"] = [{{classPrefix}}ApiClient selectHeaderAccept:@[{{#produces}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
}
@ -131,62 +132,39 @@ static NSString * basePath = @"{{basePath}}";
}
// request content type
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[{{#consumes}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}]];
NSString *requestContentType = [{{classPrefix}}ApiClient selectHeaderContentType:@[{{#consumes}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}]];
// Authentication setting
NSArray *authSettings = @[{{#authMethods}}@"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}}];
id bodyDictionary = nil;
{{#bodyParam}}
id __body = {{paramName}};
if(__body != nil && [__body isKindOfClass:[NSArray class]]){
NSMutableArray * objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)__body) {
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
{{#bodyParam}}
bodyParam = {{paramName}};
if(bodyParam != nil && [bodyParam isKindOfClass:[NSArray class]]){
NSMutableArray *objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)bodyParam) {
if([dict respondsToSelector:@selector(toDictionary)]) {
[objs addObject:[(SWGObject*)dict toDictionary]];
[objs addObject:[({{classPrefix}}Object*)dict toDictionary]];
}
else{
[objs addObject:dict];
}
}
bodyDictionary = objs;
bodyParam = objs;
}
else if([__body respondsToSelector:@selector(toDictionary)]) {
bodyDictionary = [(SWGObject*)__body toDictionary];
else if([bodyParam respondsToSelector:@selector(toDictionary)]) {
bodyParam = [({{classPrefix}}Object*)bodyParam toDictionary];
}
else if([__body isKindOfClass:[NSString class]]) {
// convert it to a dictionary
NSError * error;
NSString * str = (NSString*)__body;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: &error];
bodyDictionary = JSON;
}
{{/bodyParam}}
{{^bodyParam}}
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
{{/bodyParam}}{{^bodyParam}}
{{#formParams}}
{{#notFile}}
formParams[@"{{paramName}}"] = {{paramName}};
{{/notFile}}{{#isFile}}
requestContentType = @"multipart/form-data";
if(bodyDictionary == nil) {
bodyDictionary = [[NSMutableArray alloc] init];
}
if({{paramName}} != nil) {
[bodyDictionary addObject:{{paramName}}];
{{paramName}}.paramName = @"{{baseName}}";
}
files[@"{{paramName}}"] = {{paramName}};
{{/isFile}}
if(bodyDictionary == nil) {
bodyDictionary = [[NSMutableArray alloc] init];
}
[bodyDictionary addObject:formParams];
{{/formParams}}
{{/bodyParam}}
@ -200,14 +178,17 @@ static NSString * basePath = @"{{basePath}}";
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"{{httpMethod}}"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: {{^returnType}}nil{{/returnType}}{{#returnType}}@"{{{ returnType }}}"{{/returnType}}
completionBlock: ^(id data, NSError *error) {
{{^returnType}}completionBlock(error);{{/returnType}}
{{#returnType}}completionBlock([self.apiClient deserialize: data class:@"{{{returnType}}}"], error);{{/returnType}}
{{#returnType}}completionBlock(({{{ returnType }}})data, error);{{/returnType}}
}
];
}
@ -217,6 +198,3 @@ static NSString * basePath = @"{{basePath}}";
{{newline}}
{{/operations}}
@end

View File

@ -1,16 +1,16 @@
#import <Foundation/Foundation.h>
{{#imports}}#import "{{import}}.h"
{{/imports}}
#import "SWGObject.h"
#import "SWGApiClient.h"
#import "{{classPrefix}}Object.h"
#import "{{classPrefix}}ApiClient.h"
{{newline}}
{{#operations}}
@interface {{classname}}: NSObject
@property(nonatomic, assign)SWGApiClient *apiClient;
@property(nonatomic, assign){{classPrefix}}ApiClient *apiClient;
-(instancetype) initWithApiClient:(SWGApiClient *)apiClient;
-(instancetype) initWithApiClient:({{classPrefix}}ApiClient *)apiClient;
-(void) addHeader:(NSString*)value forKey:(NSString*)key;
-(unsigned long) requestQueueSize;
+({{classname}}*) apiWithHeader:(NSString*)headerValue key:(NSString*)key;

View File

@ -1,5 +1,5 @@
#import <Foundation/Foundation.h>
#import "SWGObject.h"
#import "{{classPrefix}}Object.h"
{{#imports}}#import "{{import}}.h"
{{/imports}}
{{newline}}
@ -9,7 +9,7 @@
@protocol {{classname}}
@end
@interface {{classname}} : SWGObject
@interface {{classname}} : {{classPrefix}}Object
{{#vars}}
{{#description}}/* {{{description}}} {{^required}}[optional]{{/required}}

View File

@ -0,0 +1,31 @@
#
# Be sure to run `pod lib lint {{podName}}.podspec' to ensure this is a
# valid spec and remove all comments before submitting the spec.
#
# Any lines starting with a # are optional, but encouraged
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = "{{podName}}"
s.version = "{{podVersion}}"
{{#apiInfo}}{{#apis}}{{^hasMore}}
s.summary = "{{appName}}"
s.description = <<-DESC
{{appDescription}}
DESC
{{/hasMore}}{{/apis}}{{/apiInfo}}
s.platform = :ios, '7.0'
s.requires_arc = true
s.framework = 'SystemConfiguration'
s.source_files = '{{podName}}/**/*'
s.public_header_files = '{{podName}}/**/*.h'
s.dependency 'AFNetworking', '~> 2.3'
s.dependency 'JSONModel', '~> 1.1'
s.dependency 'ISO8601', '~> 0.3'
end

View File

@ -1,5 +0,0 @@
platform :ios, '6.0'
xcodeproj 'SwaggerClient/SwaggerClient.xcodeproj'
pod 'AFNetworking', '~> 2.1'
pod 'JSONModel', '~> 1.0'
pod 'ISO8601'

View File

@ -1,36 +0,0 @@
PODS:
- AFNetworking (2.5.4):
- AFNetworking/NSURLConnection (= 2.5.4)
- AFNetworking/NSURLSession (= 2.5.4)
- AFNetworking/Reachability (= 2.5.4)
- AFNetworking/Security (= 2.5.4)
- AFNetworking/Serialization (= 2.5.4)
- AFNetworking/UIKit (= 2.5.4)
- AFNetworking/NSURLConnection (2.5.4):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/NSURLSession (2.5.4):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/Reachability (2.5.4)
- AFNetworking/Security (2.5.4)
- AFNetworking/Serialization (2.5.4)
- AFNetworking/UIKit (2.5.4):
- AFNetworking/NSURLConnection
- AFNetworking/NSURLSession
- ISO8601 (0.3.0)
- JSONModel (1.1.0)
DEPENDENCIES:
- AFNetworking (~> 2.1)
- ISO8601
- JSONModel (~> 1.0)
SPEC CHECKSUMS:
AFNetworking: 05edc0ac4c4c8cf57bcf4b84be5b0744b6d8e71e
ISO8601: 8d8a22d5edf0554a1cf75bac028c76c1dc0ffaef
JSONModel: ec77e9865236a7a09d9cf7668df6b4b328d9ec1d
COCOAPODS: 0.37.1

View File

@ -0,0 +1,19 @@
# SwaggerClient
## Requirements
The API client library requires ARC (Automatic Reference Counting) to be enabled in your Xcode project.
## Installation
To install it, put the API client library in your project and then simply add the following line to your Podfile:
```ruby
pod "SwaggerClient", :path => "/path/to/lib"
```
## Author
apiteam@swagger.io

View File

@ -0,0 +1,31 @@
#
# Be sure to run `pod lib lint SwaggerClient.podspec' to ensure this is a
# valid spec and remove all comments before submitting the spec.
#
# Any lines starting with a # are optional, but encouraged
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = "SwaggerClient"
s.version = "1.0.0"
s.summary = "Swagger Petstore"
s.description = <<-DESC
This is a sample server Petstore server. You can find out more about Swagger at &lt;a href=\&quot;http://swagger.io\&quot;&gt;http://swagger.io&lt;/a&gt; or on irc.freenode.net, #swagger. For this sample, you can use the api key \&quot;special-key\&quot; to test the authorization filters
DESC
s.platform = :ios, '7.0'
s.requires_arc = true
s.framework = 'SystemConfiguration'
s.source_files = 'SwaggerClient/**/*'
s.public_header_files = 'SwaggerClient/**/*.h'
s.dependency 'AFNetworking', '~> 2.3'
s.dependency 'JSONModel', '~> 1.1'
s.dependency 'ISO8601', '~> 0.3'
end

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:SwaggerClient/SwaggerClient.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "0"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
scope = "0"
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

View File

@ -1,7 +1,11 @@
#import <Foundation/Foundation.h>
#import <ISO8601/ISO8601.h>
#import "AFHTTPRequestOperationManager.h"
#import "SWGJSONResponseSerializer.h"
#import <AFNetworking/AFHTTPRequestOperationManager.h>
#import "SWGJSONResponseSerializer.h"
#import "SWGJSONRequestSerializer.h"
#import "SWGQueryParamCollection.h"
#import "SWGConfiguration.h"
#import "SWGUser.h"
#import "SWGCategory.h"
@ -22,11 +26,6 @@ extern NSString *const SWGResponseObjectErrorKey;
@property(nonatomic, assign) NSURLRequestCachePolicy cachePolicy;
@property(nonatomic, assign) NSTimeInterval timeoutInterval;
@property(nonatomic, assign) BOOL logRequests;
@property(nonatomic, assign) BOOL logCacheHits;
@property(nonatomic, assign) BOOL logServerResponses;
@property(nonatomic, assign) BOOL logJSON;
@property(nonatomic, assign) BOOL logHTTP;
@property(nonatomic, readonly) NSOperationQueue* queue;
/**
@ -45,13 +44,6 @@ extern NSString *const SWGResponseObjectErrorKey;
*/
+(NSOperationQueue*) sharedQueue;
/**
* Turn on logging
*
* @param state logging state, must be `YES` or `NO`
*/
+(void)setLoggingEnabled:(bool) state;
/**
* Clear Cache
*/
@ -175,6 +167,17 @@ extern NSString *const SWGResponseObjectErrorKey;
*/
- (id) deserialize:(id) data class:(NSString *) class;
/**
* Logging request and response
*
* @param operation AFHTTPRequestOperation for the HTTP request.
* @param request The HTTP request.
* @param error The error of the HTTP request.
*/
- (void)logResponse:(AFHTTPRequestOperation *)operation
forRequest:(NSURLRequest *)request
error:(NSError *)error;
/**
* Perform request
*
@ -193,15 +196,14 @@ extern NSString *const SWGResponseObjectErrorKey;
-(NSNumber*) requestWithCompletionBlock:(NSString*) path
method:(NSString*) method
queryParams:(NSDictionary*) queryParams
formParams:(NSDictionary *) formParams
files:(NSDictionary *) files
body:(id) body
headerParams:(NSDictionary*) headerParams
authSettings: (NSArray *) authSettings
requestContentType:(NSString*) requestContentType
responseContentType:(NSString*) responseContentType
responseType:(NSString *) responseType
completionBlock:(void (^)(id, NSError *))completionBlock;
@end

View File

@ -1,7 +1,4 @@
#import "SWGApiClient.h"
#import "SWGFile.h"
#import "SWGQueryParamCollection.h"
#import "SWGConfiguration.h"
@implementation SWGApiClient
@ -14,31 +11,38 @@ static bool cacheEnabled = false;
static AFNetworkReachabilityStatus reachabilityStatus = AFNetworkReachabilityStatusNotReachable;
static NSOperationQueue* sharedQueue;
static void (^reachabilityChangeBlock)(int);
static bool loggingEnabled = true;
#pragma mark - Log Methods
+(void)setLoggingEnabled:(bool) state {
loggingEnabled = state;
- (void)logResponse:(AFHTTPRequestOperation *)operation
forRequest:(NSURLRequest *)request
error:(NSError*)error {
SWGConfiguration *config = [SWGConfiguration sharedConfig];
NSString *message = [NSString stringWithFormat:@"\n[DEBUG] Request body \n~BEGIN~\n %@\n~END~\n"\
"[DEBUG] HTTP Response body \n~BEGIN~\n %@\n~END~\n",
[[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding],
operation.responseString];
if (config.loggingFileHanlder) {
[config.loggingFileHanlder seekToEndOfFile];
[config.loggingFileHanlder writeData:[message dataUsingEncoding:NSUTF8StringEncoding]];
}
NSLog(@"%@", message);
}
- (void)logRequest:(NSURLRequest*)request {
NSLog(@"request: %@", [self descriptionForRequest:request]);
}
#pragma mark - Cache Methods
- (void)logResponse:(id)data forRequest:(NSURLRequest*)request error:(NSError*)error {
NSLog(@"request: %@ response: %@ ", [self descriptionForRequest:request], data );
+ (void) setCacheEnabled:(BOOL)enabled {
cacheEnabled = enabled;
}
#pragma mark -
+(void)clearCache {
[[NSURLCache sharedURLCache] removeAllCachedResponses];
}
+(void)setCacheEnabled:(BOOL)enabled {
cacheEnabled = enabled;
}
#pragma mark -
+(void)configureCacheWithMemoryAndDiskCapacity: (unsigned long) memorySize
diskSize: (unsigned long) diskSize {
@ -83,10 +87,10 @@ static bool loggingEnabled = true;
if (client == nil) {
client = [[SWGApiClient alloc] initWithBaseURL:[NSURL URLWithString:baseUrl]];
[_pool setValue:client forKey:baseUrl ];
if(loggingEnabled)
if([[SWGConfiguration sharedConfig] debug])
NSLog(@"new client for path %@", baseUrl);
}
if(loggingEnabled)
if([[SWGConfiguration sharedConfig] debug])
NSLog(@"returning client for path %@", baseUrl);
return client;
}
@ -149,7 +153,7 @@ static bool loggingEnabled = true;
+(NSNumber*) nextRequestId {
@synchronized(self) {
long nextId = ++requestId;
if(loggingEnabled)
if([[SWGConfiguration sharedConfig] debug])
NSLog(@"got id %ld", nextId);
return [NSNumber numberWithLong:nextId];
}
@ -157,7 +161,7 @@ static bool loggingEnabled = true;
+(NSNumber*) queueRequest {
NSNumber* requestId = [SWGApiClient nextRequestId];
if(loggingEnabled)
if([[SWGConfiguration sharedConfig] debug])
NSLog(@"added %@ to request queue", requestId);
[queuedRequests addObject:requestId];
return requestId;
@ -190,7 +194,7 @@ static bool loggingEnabled = true;
}];
if(matchingItems.count == 1) {
if(loggingEnabled)
if([[SWGConfiguration sharedConfig] debug])
NSLog(@"removing request id %@", requestId);
[queuedRequests removeObject:requestId];
return true;
@ -225,25 +229,25 @@ static bool loggingEnabled = true;
reachabilityStatus = status;
switch (status) {
case AFNetworkReachabilityStatusUnknown:
if(loggingEnabled)
if([[SWGConfiguration sharedConfig] debug])
NSLog(@"reachability changed to AFNetworkReachabilityStatusUnknown");
[SWGApiClient setOfflineState:true];
break;
case AFNetworkReachabilityStatusNotReachable:
if(loggingEnabled)
if([[SWGConfiguration sharedConfig] debug])
NSLog(@"reachability changed to AFNetworkReachabilityStatusNotReachable");
[SWGApiClient setOfflineState:true];
break;
case AFNetworkReachabilityStatusReachableViaWWAN:
if(loggingEnabled)
if([[SWGConfiguration sharedConfig] debug])
NSLog(@"reachability changed to AFNetworkReachabilityStatusReachableViaWWAN");
[SWGApiClient setOfflineState:false];
break;
case AFNetworkReachabilityStatusReachableViaWiFi:
if(loggingEnabled)
if([[SWGConfiguration sharedConfig] debug])
NSLog(@"reachability changed to AFNetworkReachabilityStatusReachableViaWiFi");
[SWGApiClient setOfflineState:false];
break;
@ -268,7 +272,6 @@ static bool loggingEnabled = true;
for(NSString * key in [queryParams keyEnumerator]){
if(counter == 0) separator = @"?";
else separator = @"&";
NSString * value;
id queryParam = [queryParams valueForKey:key];
if([queryParam isKindOfClass:[NSString class]]){
[requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator,
@ -314,11 +317,6 @@ static bool loggingEnabled = true;
return requestUrl;
}
- (NSString*)descriptionForRequest:(NSURLRequest*)request {
return [[request URL] absoluteString];
}
/**
* Update header and query params based on authentication settings
*/
@ -359,8 +357,8 @@ static bool loggingEnabled = true;
NSMutableArray *resultArray = nil;
NSMutableDictionary *resultDict = nil;
// return nil if data is nil
if (!data) {
// return nil if data is nil or class is nil
if (!data || !class) {
return nil;
}
@ -473,20 +471,112 @@ static bool loggingEnabled = true;
return nil;
}
#pragma mark - Operation Methods
- (void) operationWithCompletionBlock: (NSURLRequest *)request
requestId: (NSNumber *) requestId
completionBlock: (void (^)(id, NSError *))completionBlock {
AFHTTPRequestOperation *op = [self HTTPRequestOperationWithRequest:request
success:^(AFHTTPRequestOperation *operation, id response) {
if([self executeRequestWithId:requestId]) {
if([[SWGConfiguration sharedConfig] debug]) {
[self logResponse:operation forRequest:request error:nil];
}
completionBlock(response, nil);
}
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
if([self executeRequestWithId:requestId]) {
NSMutableDictionary *userInfo = [error.userInfo mutableCopy];
if(operation.responseObject) {
// Add in the (parsed) response body.
userInfo[SWGResponseObjectErrorKey] = operation.responseObject;
}
NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo];
if([[SWGConfiguration sharedConfig] debug])
[self logResponse:nil forRequest:request error:augmentedError];
completionBlock(nil, augmentedError);
}
}];
[self.operationQueue addOperation:op];
}
- (void) downloadOperationWithCompletionBlock: (NSURLRequest *)request
requestId: (NSNumber *) requestId
completionBlock: (void (^)(id, NSError *))completionBlock {
AFHTTPRequestOperation *op = [self HTTPRequestOperationWithRequest:request
success:^(AFHTTPRequestOperation *operation, id responseObject) {
SWGConfiguration *config = [SWGConfiguration sharedConfig];
NSString *directory = nil;
if (config.tempFolderPath) {
directory = config.tempFolderPath;
}
else {
directory = NSTemporaryDirectory();
}
NSDictionary *headers = operation.response.allHeaderFields;
NSString *filename = nil;
if ([headers objectForKey:@"Content-Disposition"]) {
NSString *pattern = @"filename=['\"]?([^'\"\\s]+)['\"]?";
NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:pattern
options:NSRegularExpressionCaseInsensitive
error:nil];
NSString *contentDispositionHeader = [headers objectForKey:@"Content-Disposition"];
NSTextCheckingResult *match = [regexp firstMatchInString:contentDispositionHeader
options:0
range:NSMakeRange(0, [contentDispositionHeader length])];
filename = [contentDispositionHeader substringWithRange:[match rangeAtIndex:1]];
}
else {
filename = [NSString stringWithFormat:@"%@", [[NSProcessInfo processInfo] globallyUniqueString]];
}
NSString *filepath = [directory stringByAppendingPathComponent:filename];
NSURL *file = [NSURL fileURLWithPath:filepath];
[operation.responseData writeToURL:file atomically:YES];
completionBlock(file, nil);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
if ([self executeRequestWithId:requestId]) {
NSMutableDictionary *userInfo = [error.userInfo mutableCopy];
if (operation.responseObject) {
userInfo[SWGResponseObjectErrorKey] = operation.responseObject;
}
NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo];
if ([[SWGConfiguration sharedConfig] debug]) {
[self logResponse:nil forRequest:request error:augmentedError];
}
completionBlock(nil, augmentedError);
}
}];
[self.operationQueue addOperation:op];
}
#pragma mark - Perform Request Methods
-(NSNumber*) requestWithCompletionBlock: (NSString*) path
method: (NSString*) method
queryParams: (NSDictionary*) queryParams
formParams: (NSDictionary *) formParams
files: (NSDictionary *) files
body: (id) body
headerParams: (NSDictionary*) headerParams
authSettings: (NSArray *) authSettings
requestContentType: (NSString*) requestContentType
responseContentType: (NSString*) responseContentType
responseType: (NSString *) responseType
completionBlock: (void (^)(id, NSError *))completionBlock {
// setting request serializer
if ([requestContentType isEqualToString:@"application/json"]) {
self.requestSerializer = [AFJSONRequestSerializer serializer];
self.requestSerializer = [SWGJSONRequestSerializer serializer];
}
else if ([requestContentType isEqualToString:@"application/x-www-form-urlencoded"]) {
self.requestSerializer = [AFHTTPRequestSerializer serializer];
@ -510,68 +600,42 @@ static bool loggingEnabled = true;
[self updateHeaderParams:&headerParams queryParams:&queryParams WithAuthSettings:authSettings];
NSMutableURLRequest * request = nil;
if (body != nil && [body isKindOfClass:[NSArray class]]){
SWGFile * file;
NSMutableDictionary * params = [[NSMutableDictionary alloc] init];
for(id obj in body) {
if([obj isKindOfClass:[SWGFile class]]) {
file = (SWGFile*) obj;
requestContentType = @"multipart/form-data";
}
else if([obj isKindOfClass:[NSDictionary class]]) {
for(NSString * key in obj) {
params[key] = obj[key];
}
}
}
NSString * urlString = [[NSURL URLWithString:path relativeToURL:self.baseURL] absoluteString];
// request with multipart form
if([requestContentType isEqualToString:@"multipart/form-data"]) {
request = [self.requestSerializer multipartFormRequestWithMethod: @"POST"
URLString: urlString
parameters: nil
constructingBodyWithBlock: ^(id<AFMultipartFormData> formData) {
for(NSString * key in params) {
NSData* data = [params[key] dataUsingEncoding:NSUTF8StringEncoding];
[formData appendPartWithFormData: data name: key];
}
if (file) {
[formData appendPartWithFileData: [file data]
name: [file paramName]
fileName: [file name]
mimeType: [file mimeType]];
}
}
error:nil];
}
// request with form parameters or json
else {
NSString* pathWithQueryParams = [self pathWithQueryParamsToString:path queryParams:queryParams];
NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString];
request = [self.requestSerializer requestWithMethod:method
URLString:urlString
parameters:params
error:nil];
}
NSString* pathWithQueryParams = [self pathWithQueryParamsToString:path queryParams:queryParams];
NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString];
if (files.count > 0) {
request = [self.requestSerializer multipartFormRequestWithMethod:@"POST"
URLString:urlString
parameters:nil
constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
[formParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
NSData *data = [obj dataUsingEncoding:NSUTF8StringEncoding];
[formData appendPartWithFormData:data name:key];
}];
[files enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
NSURL *filePath = (NSURL *)obj;
[formData appendPartWithFileURL:filePath name:key error:nil];
}];
} error:nil];
}
else {
NSString * pathWithQueryParams = [self pathWithQueryParamsToString:path queryParams:queryParams];
NSString * urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString];
request = [self.requestSerializer requestWithMethod: method
URLString: urlString
parameters: body
error: nil];
if (formParams) {
request = [self.requestSerializer requestWithMethod:method
URLString:urlString
parameters:formParams
error:nil];
}
if (body) {
request = [self.requestSerializer requestWithMethod:method
URLString:urlString
parameters:body
error:nil];
}
}
BOOL hasHeaderParams = false;
if(headerParams != nil && [headerParams count] > 0)
if(headerParams != nil && [headerParams count] > 0) {
hasHeaderParams = true;
}
if(offlineState) {
NSLog(@"%@ cache forced", path);
[request setCachePolicy:NSURLRequestReturnCacheDataDontLoad];
@ -585,17 +649,7 @@ static bool loggingEnabled = true;
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
}
if(body != nil) {
if([body isKindOfClass:[NSDictionary class]] || [body isKindOfClass:[NSArray class]]){
[self.requestSerializer setValue:requestContentType forHTTPHeaderField:@"Content-Type"];
}
else if ([body isKindOfClass:[SWGFile class]]){}
else {
NSAssert(false, @"unsupported post type!");
}
}
if(headerParams != nil){
if(hasHeaderParams){
for(NSString * key in [headerParams keyEnumerator]){
[request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key];
}
@ -607,30 +661,16 @@ static bool loggingEnabled = true;
[request setHTTPShouldHandleCookies:NO];
NSNumber* requestId = [SWGApiClient queueRequest];
AFHTTPRequestOperation *op = [self HTTPRequestOperationWithRequest:request
success:^(AFHTTPRequestOperation *operation, id response) {
if([self executeRequestWithId:requestId]) {
if(self.logServerResponses) {
[self logResponse:response forRequest:request error:nil];
}
completionBlock(response, nil);
}
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
if([self executeRequestWithId:requestId]) {
NSMutableDictionary *userInfo = [error.userInfo mutableCopy];
if(operation.responseObject) {
// Add in the (parsed) response body.
userInfo[SWGResponseObjectErrorKey] = operation.responseObject;
}
NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo];
if(self.logServerResponses)
[self logResponse:nil forRequest:request error:augmentedError];
completionBlock(nil, augmentedError);
}
}];
[self.operationQueue addOperation:op];
if ([responseType isEqualToString:@"NSURL*"]) {
[self downloadOperationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) {
completionBlock(data, error);
}];
}
else {
[self operationWithCompletionBlock:request requestId:requestId completionBlock:^(id data, NSError *error) {
completionBlock([self deserialize:data class:responseType], error);
}];
}
return requestId;
}
@ -639,8 +679,3 @@ static bool loggingEnabled = true;

View File

@ -23,6 +23,18 @@
@property (nonatomic) NSString *username;
@property (nonatomic) NSString *password;
/**
* Temp folder for file download
*/
@property (nonatomic) NSString *tempFolderPath;
/**
* Logging Settings
*/
@property (nonatomic) BOOL debug;
@property (nonatomic) NSString *loggingFile;
@property (nonatomic) NSFileHandle *loggingFileHanlder;
/**
* Get configuration singleton instance
*/

View File

@ -27,6 +27,9 @@
if (self) {
self.username = @"";
self.password = @"";
self.tempFolderPath = nil;
self.debug = NO;
self.loggingFile = nil;
self.mutableApiKey = [NSMutableDictionary dictionary];
self.mutableApiKeyPrefix = [NSMutableDictionary dictionary];
}
@ -65,6 +68,20 @@
[self.mutableApiKeyPrefix setValue:value forKey:field];
}
- (void) setLoggingFile:(NSString *)loggingFile {
// close old file handler
if ([self.loggingFileHanlder isKindOfClass:[NSFileHandle class]]) {
[self.loggingFileHanlder closeFile];
}
_loggingFile = loggingFile;
self.loggingFileHanlder = [NSFileHandle fileHandleForWritingAtPath:_loggingFile];
if (self.loggingFileHanlder == nil) {
[[NSFileManager defaultManager] createFileAtPath:_loggingFile contents:nil attributes:nil];
self.loggingFileHanlder = [NSFileHandle fileHandleForWritingAtPath:_loggingFile];
}
}
#pragma mark - Getter Methods
- (NSDictionary *) apiKey {

View File

@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
#import <AFNetworking/AFURLRequestSerialization.h>
@interface SWGJSONRequestSerializer : AFJSONRequestSerializer
@end

View File

@ -0,0 +1,35 @@
#import "SWGJSONRequestSerializer.h"
@implementation SWGJSONRequestSerializer
///
/// When customize a request serializer,
/// the serializer must conform the protocol `AFURLRequestSerialization`
/// and implements the protocol method `requestBySerializingRequest:withParameters:error:`
///
/// @param request The original request.
/// @param parameters The parameters to be encoded.
/// @param error The error that occurred while attempting to encode the request parameters.
///
/// @return A serialized request.
///
- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request
withParameters:(id)parameters
error:(NSError *__autoreleasing *)error
{
// If the body data which will be serialized isn't NSArray or NSDictionary
// then put the data in the http request body directly.
if ([parameters isKindOfClass:[NSArray class]] || [parameters isKindOfClass:[NSDictionary class]]) {
return [super requestBySerializingRequest:request withParameters:parameters error:error];
} else {
NSMutableURLRequest *mutableRequest = [request mutableCopy];
if (parameters) {
[mutableRequest setHTTPBody:[parameters dataUsingEncoding:self.stringEncoding]];
}
return mutableRequest;
}
}
@end

View File

@ -1,5 +1,5 @@
#import <Foundation/Foundation.h>
#import "JSONModel.h"
#import <JSONModel/JSONModel.h>
@interface SWGObject : JSONModel
@end

View File

@ -19,6 +19,6 @@
*/
@property(nonatomic) NSString* status;
@property(nonatomic) BOOL complete;
@property(nonatomic) NSNumber* complete;
@end

View File

@ -1,6 +1,5 @@
#import <Foundation/Foundation.h>
#import "SWGPet.h"
#import "SWGFile.h"
#import "SWGObject.h"
#import "SWGApiClient.h"
@ -114,13 +113,13 @@
/// Deletes a pet
///
///
/// @param apiKey
/// @param petId Pet id to delete
/// @param apiKey
///
///
/// @return
-(NSNumber*) deletePetWithCompletionBlock :(NSString*) apiKey
petId:(NSNumber*) petId
-(NSNumber*) deletePetWithCompletionBlock :(NSNumber*) petId
apiKey:(NSString*) apiKey
completionHandler: (void (^)(NSError* error))completionBlock;
@ -139,7 +138,7 @@
/// @return
-(NSNumber*) uploadFileWithCompletionBlock :(NSNumber*) petId
additionalMetadata:(NSString*) additionalMetadata
file:(SWGFile*) file
file:(NSURL*) file
completionHandler: (void (^)(NSError* error))completionBlock;

View File

@ -1,8 +1,6 @@
#import "SWGPetApi.h"
#import "SWGFile.h"
#import "SWGQueryParamCollection.h"
#import "SWGPet.h"
#import "SWGFile.h"
@interface SWGPetApi ()
@ -83,7 +81,7 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
-(NSNumber*) updatePetWithCompletionBlock: (SWGPet*) body
completionHandler: (void (^)(NSError* error))completionBlock {
completionHandler: (void (^)(NSError* error))completionBlock {
@ -100,8 +98,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -121,14 +119,16 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[@"petstore_auth"];
id bodyDictionary = nil;
id __body = body;
if(__body != nil && [__body isKindOfClass:[NSArray class]]){
NSMutableArray * objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)__body) {
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
bodyParam = body;
if(bodyParam != nil && [bodyParam isKindOfClass:[NSArray class]]){
NSMutableArray *objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)bodyParam) {
if([dict respondsToSelector:@selector(toDictionary)]) {
[objs addObject:[(SWGObject*)dict toDictionary]];
}
@ -136,33 +136,25 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
[objs addObject:dict];
}
}
bodyDictionary = objs;
bodyParam = objs;
}
else if([__body respondsToSelector:@selector(toDictionary)]) {
bodyDictionary = [(SWGObject*)__body toDictionary];
else if([bodyParam respondsToSelector:@selector(toDictionary)]) {
bodyParam = [(SWGObject*)bodyParam toDictionary];
}
else if([__body isKindOfClass:[NSString class]]) {
// convert it to a dictionary
NSError * error;
NSString * str = (NSString*)__body;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: &error];
bodyDictionary = JSON;
}
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"PUT"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
@ -180,7 +172,7 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
-(NSNumber*) addPetWithCompletionBlock: (SWGPet*) body
completionHandler: (void (^)(NSError* error))completionBlock {
completionHandler: (void (^)(NSError* error))completionBlock {
@ -197,8 +189,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -218,14 +210,16 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[@"petstore_auth"];
id bodyDictionary = nil;
id __body = body;
if(__body != nil && [__body isKindOfClass:[NSArray class]]){
NSMutableArray * objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)__body) {
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
bodyParam = body;
if(bodyParam != nil && [bodyParam isKindOfClass:[NSArray class]]){
NSMutableArray *objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)bodyParam) {
if([dict respondsToSelector:@selector(toDictionary)]) {
[objs addObject:[(SWGObject*)dict toDictionary]];
}
@ -233,33 +227,25 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
[objs addObject:dict];
}
}
bodyDictionary = objs;
bodyParam = objs;
}
else if([__body respondsToSelector:@selector(toDictionary)]) {
bodyDictionary = [(SWGObject*)__body toDictionary];
else if([bodyParam respondsToSelector:@selector(toDictionary)]) {
bodyParam = [(SWGObject*)bodyParam toDictionary];
}
else if([__body isKindOfClass:[NSString class]]) {
// convert it to a dictionary
NSError * error;
NSString * str = (NSString*)__body;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: &error];
bodyDictionary = JSON;
}
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"POST"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
@ -276,8 +262,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
///
-(NSNumber*) findPetsByStatusWithCompletionBlock: (NSArray*) status
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error))completionBlock
{
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error))completionBlock {
@ -300,8 +286,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -321,13 +307,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[@"petstore_auth"];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -335,14 +319,17 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"GET"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"NSArray<SWGPet>*"
completionBlock: ^(id data, NSError *error) {
completionBlock([self.apiClient deserialize: data class:@"NSArray<SWGPet>*"], error);
completionBlock((NSArray<SWGPet>*)data, error);
}
];
}
@ -356,8 +343,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
///
-(NSNumber*) findPetsByTagsWithCompletionBlock: (NSArray*) tags
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error))completionBlock
{
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error))completionBlock {
@ -380,8 +367,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -401,13 +388,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[@"petstore_auth"];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -415,14 +400,17 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"GET"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"NSArray<SWGPet>*"
completionBlock: ^(id data, NSError *error) {
completionBlock([self.apiClient deserialize: data class:@"NSArray<SWGPet>*"], error);
completionBlock((NSArray<SWGPet>*)data, error);
}
];
}
@ -436,12 +424,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
///
-(NSNumber*) getPetByIdWithCompletionBlock: (NSNumber*) petId
completionHandler: (void (^)(SWGPet* output, NSError* error))completionBlock
{
completionHandler: (void (^)(SWGPet* output, NSError* error))completionBlock {
// verify the required parameter 'petId' is set
NSAssert(petId != nil, @"Missing the required parameter `petId` when calling getPetById");
if (petId == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `getPetById`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}", basePath];
@ -458,8 +448,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -479,13 +469,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[@"api_key", @"petstore_auth"];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -493,14 +481,17 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"GET"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"SWGPet*"
completionBlock: ^(id data, NSError *error) {
completionBlock([self.apiClient deserialize: data class:@"SWGPet*"], error);
completionBlock((SWGPet*)data, error);
}
];
}
@ -521,11 +512,13 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
status: (NSString*) status
completionHandler: (void (^)(NSError* error))completionBlock {
completionHandler: (void (^)(NSError* error))completionBlock {
// verify the required parameter 'petId' is set
NSAssert(petId != nil, @"Missing the required parameter `petId` when calling updatePetWithForm");
if (petId == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `updatePetWithForm`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}", basePath];
@ -542,8 +535,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -563,29 +556,19 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[@"petstore_auth"];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
formParams[@"name"] = name;
if(bodyDictionary == nil) {
bodyDictionary = [[NSMutableArray alloc] init];
}
[bodyDictionary addObject:formParams];
formParams[@"status"] = status;
if(bodyDictionary == nil) {
bodyDictionary = [[NSMutableArray alloc] init];
}
[bodyDictionary addObject:formParams];
@ -593,11 +576,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"POST"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
@ -608,21 +594,23 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
///
/// Deletes a pet
///
/// @param apiKey
///
/// @param petId Pet id to delete
///
/// @param apiKey
///
/// @returns void
///
-(NSNumber*) deletePetWithCompletionBlock: (NSString*) apiKey
petId: (NSNumber*) petId
-(NSNumber*) deletePetWithCompletionBlock: (NSNumber*) petId
apiKey: (NSString*) apiKey
completionHandler: (void (^)(NSError* error))completionBlock {
completionHandler: (void (^)(NSError* error))completionBlock {
// verify the required parameter 'petId' is set
NSAssert(petId != nil, @"Missing the required parameter `petId` when calling deletePet");
if (petId == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `deletePet`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}", basePath];
@ -641,8 +629,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
if(apiKey != nil)
headerParams[@"api_key"] = apiKey;
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -662,13 +650,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[@"petstore_auth"];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -676,11 +662,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"DELETE"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
@ -701,14 +690,16 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
///
-(NSNumber*) uploadFileWithCompletionBlock: (NSNumber*) petId
additionalMetadata: (NSString*) additionalMetadata
file: (SWGFile*) file
file: (NSURL*) file
completionHandler: (void (^)(NSError* error))completionBlock {
completionHandler: (void (^)(NSError* error))completionBlock {
// verify the required parameter 'petId' is set
NSAssert(petId != nil, @"Missing the required parameter `petId` when calling uploadFile");
if (petId == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `petId` when calling `uploadFile`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}/uploadImage", basePath];
@ -725,8 +716,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -746,36 +737,19 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[@"petstore_auth"];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
formParams[@"additionalMetadata"] = additionalMetadata;
if(bodyDictionary == nil) {
bodyDictionary = [[NSMutableArray alloc] init];
}
[bodyDictionary addObject:formParams];
requestContentType = @"multipart/form-data";
if(bodyDictionary == nil) {
bodyDictionary = [[NSMutableArray alloc] init];
}
if(file != nil) {
[bodyDictionary addObject:file];
file.paramName = @"file";
}
files[@"file"] = file;
if(bodyDictionary == nil) {
bodyDictionary = [[NSMutableArray alloc] init];
}
[bodyDictionary addObject:formParams];
@ -783,11 +757,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"POST"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
@ -798,6 +775,3 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
@end

View File

@ -1,5 +1,4 @@
#import "SWGStoreApi.h"
#import "SWGFile.h"
#import "SWGQueryParamCollection.h"
#import "SWGOrder.h"
@ -78,8 +77,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
/// @returns NSDictionary* /* NSString, NSNumber */
///
-(NSNumber*) getInventoryWithCompletionBlock:
(void (^)(NSDictionary* /* NSString, NSNumber */ output, NSError* error))completionBlock
{
(void (^)(NSDictionary* /* NSString, NSNumber */ output, NSError* error))completionBlock {
@ -96,8 +95,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -117,13 +116,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[@"api_key"];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -131,14 +128,17 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"GET"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"NSDictionary* /* NSString, NSNumber */"
completionBlock: ^(id data, NSError *error) {
completionBlock([self.apiClient deserialize: data class:@"NSDictionary* /* NSString, NSNumber */"], error);
completionBlock((NSDictionary* /* NSString, NSNumber */)data, error);
}
];
}
@ -152,8 +152,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
///
-(NSNumber*) placeOrderWithCompletionBlock: (SWGOrder*) body
completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock
{
completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock {
@ -170,8 +170,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -191,14 +191,16 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[];
id bodyDictionary = nil;
id __body = body;
if(__body != nil && [__body isKindOfClass:[NSArray class]]){
NSMutableArray * objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)__body) {
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
bodyParam = body;
if(bodyParam != nil && [bodyParam isKindOfClass:[NSArray class]]){
NSMutableArray *objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)bodyParam) {
if([dict respondsToSelector:@selector(toDictionary)]) {
[objs addObject:[(SWGObject*)dict toDictionary]];
}
@ -206,36 +208,28 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
[objs addObject:dict];
}
}
bodyDictionary = objs;
bodyParam = objs;
}
else if([__body respondsToSelector:@selector(toDictionary)]) {
bodyDictionary = [(SWGObject*)__body toDictionary];
else if([bodyParam respondsToSelector:@selector(toDictionary)]) {
bodyParam = [(SWGObject*)bodyParam toDictionary];
}
else if([__body isKindOfClass:[NSString class]]) {
// convert it to a dictionary
NSError * error;
NSString * str = (NSString*)__body;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: &error];
bodyDictionary = JSON;
}
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"POST"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"SWGOrder*"
completionBlock: ^(id data, NSError *error) {
completionBlock([self.apiClient deserialize: data class:@"SWGOrder*"], error);
completionBlock((SWGOrder*)data, error);
}
];
}
@ -249,12 +243,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
///
-(NSNumber*) getOrderByIdWithCompletionBlock: (NSString*) orderId
completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock
{
completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock {
// verify the required parameter 'orderId' is set
NSAssert(orderId != nil, @"Missing the required parameter `orderId` when calling getOrderById");
if (orderId == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `orderId` when calling `getOrderById`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store/order/{orderId}", basePath];
@ -271,8 +267,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -292,13 +288,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -306,14 +300,17 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"GET"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"SWGOrder*"
completionBlock: ^(id data, NSError *error) {
completionBlock([self.apiClient deserialize: data class:@"SWGOrder*"], error);
completionBlock((SWGOrder*)data, error);
}
];
}
@ -328,11 +325,13 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
-(NSNumber*) deleteOrderWithCompletionBlock: (NSString*) orderId
completionHandler: (void (^)(NSError* error))completionBlock {
completionHandler: (void (^)(NSError* error))completionBlock {
// verify the required parameter 'orderId' is set
NSAssert(orderId != nil, @"Missing the required parameter `orderId` when calling deleteOrder");
if (orderId == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `orderId` when calling `deleteOrder`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store/order/{orderId}", basePath];
@ -349,8 +348,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -370,13 +369,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -384,11 +381,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"DELETE"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
@ -399,6 +399,3 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
@end

View File

@ -1,5 +1,4 @@
#import "SWGUserApi.h"
#import "SWGFile.h"
#import "SWGQueryParamCollection.h"
#import "SWGUser.h"
@ -82,7 +81,7 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
-(NSNumber*) createUserWithCompletionBlock: (SWGUser*) body
completionHandler: (void (^)(NSError* error))completionBlock {
completionHandler: (void (^)(NSError* error))completionBlock {
@ -99,8 +98,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -120,14 +119,16 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[];
id bodyDictionary = nil;
id __body = body;
if(__body != nil && [__body isKindOfClass:[NSArray class]]){
NSMutableArray * objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)__body) {
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
bodyParam = body;
if(bodyParam != nil && [bodyParam isKindOfClass:[NSArray class]]){
NSMutableArray *objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)bodyParam) {
if([dict respondsToSelector:@selector(toDictionary)]) {
[objs addObject:[(SWGObject*)dict toDictionary]];
}
@ -135,33 +136,25 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
[objs addObject:dict];
}
}
bodyDictionary = objs;
bodyParam = objs;
}
else if([__body respondsToSelector:@selector(toDictionary)]) {
bodyDictionary = [(SWGObject*)__body toDictionary];
else if([bodyParam respondsToSelector:@selector(toDictionary)]) {
bodyParam = [(SWGObject*)bodyParam toDictionary];
}
else if([__body isKindOfClass:[NSString class]]) {
// convert it to a dictionary
NSError * error;
NSString * str = (NSString*)__body;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: &error];
bodyDictionary = JSON;
}
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"POST"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
@ -179,7 +172,7 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
-(NSNumber*) createUsersWithArrayInputWithCompletionBlock: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error))completionBlock {
completionHandler: (void (^)(NSError* error))completionBlock {
@ -196,8 +189,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -217,14 +210,16 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[];
id bodyDictionary = nil;
id __body = body;
if(__body != nil && [__body isKindOfClass:[NSArray class]]){
NSMutableArray * objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)__body) {
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
bodyParam = body;
if(bodyParam != nil && [bodyParam isKindOfClass:[NSArray class]]){
NSMutableArray *objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)bodyParam) {
if([dict respondsToSelector:@selector(toDictionary)]) {
[objs addObject:[(SWGObject*)dict toDictionary]];
}
@ -232,33 +227,25 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
[objs addObject:dict];
}
}
bodyDictionary = objs;
bodyParam = objs;
}
else if([__body respondsToSelector:@selector(toDictionary)]) {
bodyDictionary = [(SWGObject*)__body toDictionary];
else if([bodyParam respondsToSelector:@selector(toDictionary)]) {
bodyParam = [(SWGObject*)bodyParam toDictionary];
}
else if([__body isKindOfClass:[NSString class]]) {
// convert it to a dictionary
NSError * error;
NSString * str = (NSString*)__body;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: &error];
bodyDictionary = JSON;
}
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"POST"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
@ -276,7 +263,7 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
-(NSNumber*) createUsersWithListInputWithCompletionBlock: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error))completionBlock {
completionHandler: (void (^)(NSError* error))completionBlock {
@ -293,8 +280,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -314,14 +301,16 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[];
id bodyDictionary = nil;
id __body = body;
if(__body != nil && [__body isKindOfClass:[NSArray class]]){
NSMutableArray * objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)__body) {
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
bodyParam = body;
if(bodyParam != nil && [bodyParam isKindOfClass:[NSArray class]]){
NSMutableArray *objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)bodyParam) {
if([dict respondsToSelector:@selector(toDictionary)]) {
[objs addObject:[(SWGObject*)dict toDictionary]];
}
@ -329,33 +318,25 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
[objs addObject:dict];
}
}
bodyDictionary = objs;
bodyParam = objs;
}
else if([__body respondsToSelector:@selector(toDictionary)]) {
bodyDictionary = [(SWGObject*)__body toDictionary];
else if([bodyParam respondsToSelector:@selector(toDictionary)]) {
bodyParam = [(SWGObject*)bodyParam toDictionary];
}
else if([__body isKindOfClass:[NSString class]]) {
// convert it to a dictionary
NSError * error;
NSString * str = (NSString*)__body;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: &error];
bodyDictionary = JSON;
}
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"POST"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
@ -375,8 +356,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
-(NSNumber*) loginUserWithCompletionBlock: (NSString*) username
password: (NSString*) password
completionHandler: (void (^)(NSString* output, NSError* error))completionBlock
{
completionHandler: (void (^)(NSString* output, NSError* error))completionBlock {
@ -401,8 +382,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -422,13 +403,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -436,14 +415,17 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"GET"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"NSString*"
completionBlock: ^(id data, NSError *error) {
completionBlock([self.apiClient deserialize: data class:@"NSString*"], error);
completionBlock((NSString*)data, error);
}
];
}
@ -455,7 +437,7 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
///
-(NSNumber*) logoutUserWithCompletionBlock:
(void (^)(NSError* error))completionBlock {
(void (^)(NSError* error))completionBlock {
@ -472,8 +454,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -493,13 +475,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -507,11 +487,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"GET"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
@ -528,12 +511,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
///
-(NSNumber*) getUserByNameWithCompletionBlock: (NSString*) username
completionHandler: (void (^)(SWGUser* output, NSError* error))completionBlock
{
completionHandler: (void (^)(SWGUser* output, NSError* error))completionBlock {
// verify the required parameter 'username' is set
NSAssert(username != nil, @"Missing the required parameter `username` when calling getUserByName");
if (username == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `username` when calling `getUserByName`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/{username}", basePath];
@ -550,8 +535,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -571,13 +556,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -585,14 +568,17 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"GET"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"SWGUser*"
completionBlock: ^(id data, NSError *error) {
completionBlock([self.apiClient deserialize: data class:@"SWGUser*"], error);
completionBlock((SWGUser*)data, error);
}
];
}
@ -610,11 +596,13 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
body: (SWGUser*) body
completionHandler: (void (^)(NSError* error))completionBlock {
completionHandler: (void (^)(NSError* error))completionBlock {
// verify the required parameter 'username' is set
NSAssert(username != nil, @"Missing the required parameter `username` when calling updateUser");
if (username == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `username` when calling `updateUser`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/{username}", basePath];
@ -631,8 +619,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -652,14 +640,16 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[];
id bodyDictionary = nil;
id __body = body;
if(__body != nil && [__body isKindOfClass:[NSArray class]]){
NSMutableArray * objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)__body) {
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
bodyParam = body;
if(bodyParam != nil && [bodyParam isKindOfClass:[NSArray class]]){
NSMutableArray *objs = [[NSMutableArray alloc] init];
for (id dict in (NSArray*)bodyParam) {
if([dict respondsToSelector:@selector(toDictionary)]) {
[objs addObject:[(SWGObject*)dict toDictionary]];
}
@ -667,33 +657,25 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
[objs addObject:dict];
}
}
bodyDictionary = objs;
bodyParam = objs;
}
else if([__body respondsToSelector:@selector(toDictionary)]) {
bodyDictionary = [(SWGObject*)__body toDictionary];
else if([bodyParam respondsToSelector:@selector(toDictionary)]) {
bodyParam = [(SWGObject*)bodyParam toDictionary];
}
else if([__body isKindOfClass:[NSString class]]) {
// convert it to a dictionary
NSError * error;
NSString * str = (NSString*)__body;
NSDictionary *JSON =
[NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: &error];
bodyDictionary = JSON;
}
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"PUT"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
@ -711,11 +693,13 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
-(NSNumber*) deleteUserWithCompletionBlock: (NSString*) username
completionHandler: (void (^)(NSError* error))completionBlock {
completionHandler: (void (^)(NSError* error))completionBlock {
// verify the required parameter 'username' is set
NSAssert(username != nil, @"Missing the required parameter `username` when calling deleteUser");
if (username == nil) {
[NSException raise:@"Invalid parameter" format:@"Missing the required parameter `username` when calling `deleteUser`"];
}
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/{username}", basePath];
@ -732,8 +716,8 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
// HTTP header `Accept`
// HTTP header `Accept`
headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]];
if ([headerParams[@"Accept"] length] == 0) {
[headerParams removeObjectForKey:@"Accept"];
@ -753,13 +737,11 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
// Authentication setting
NSArray *authSettings = @[];
id bodyDictionary = nil;
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *files = [[NSMutableDictionary alloc] init];
@ -767,11 +749,14 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
return [self.apiClient requestWithCompletionBlock: requestUrl
method: @"DELETE"
queryParams: queryParams
body: bodyDictionary
formParams: formParams
files: files
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: nil
completionBlock: ^(id data, NSError *error) {
completionBlock(error);
@ -782,6 +767,3 @@ static NSString * basePath = @"http://petstore.swagger.io/v2";
@end

View File

@ -1,688 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
BA525648922D4C0E9F44D4F1 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 73DA4F1067C343C3962F1542 /* libPods.a */; };
CF0560EB1B1855CF00C0D4EC /* SWGConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = CF0560EA1B1855CF00C0D4EC /* SWGConfiguration.m */; };
CF31D0991B105E4B00509935 /* SWGApiClientTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CF31D0981B105E4B00509935 /* SWGApiClientTest.m */; };
CF5B6E2D1B2BD70800862A1C /* UserApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CF5B6E2C1B2BD70800862A1C /* UserApiTest.m */; };
CFB37D061B2B11DD00D2E5F1 /* StoreApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFB37D051B2B11DC00D2E5F1 /* StoreApiTest.m */; };
CFCEFE511B2C1330006313BE /* SWGJSONResponseSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = CFCEFE501B2C1330006313BE /* SWGJSONResponseSerializer.m */; };
CFD1B6701B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m in Sources */ = {isa = PBXBuildFile; fileRef = CFD1B66F1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m */; };
CFD1B6711B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m in Sources */ = {isa = PBXBuildFile; fileRef = CFD1B66F1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m */; };
EA66999A1811D2FA00A70D03 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA6699991811D2FA00A70D03 /* Foundation.framework */; };
EA66999C1811D2FA00A70D03 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA66999B1811D2FA00A70D03 /* CoreGraphics.framework */; };
EA66999E1811D2FA00A70D03 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA66999D1811D2FA00A70D03 /* UIKit.framework */; };
EA6699A41811D2FA00A70D03 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA6699A21811D2FA00A70D03 /* InfoPlist.strings */; };
EA6699A61811D2FA00A70D03 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = EA6699A51811D2FA00A70D03 /* main.m */; };
EA6699AA1811D2FA00A70D03 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = EA6699A91811D2FA00A70D03 /* AppDelegate.m */; };
EA6699AD1811D2FA00A70D03 /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EA6699AB1811D2FA00A70D03 /* Main_iPhone.storyboard */; };
EA6699B01811D2FA00A70D03 /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EA6699AE1811D2FA00A70D03 /* Main_iPad.storyboard */; };
EA6699B31811D2FA00A70D03 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EA6699B21811D2FA00A70D03 /* ViewController.m */; };
EA6699B51811D2FA00A70D03 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EA6699B41811D2FA00A70D03 /* Images.xcassets */; };
EA6699BD1811D2FB00A70D03 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA6699991811D2FA00A70D03 /* Foundation.framework */; };
EA6699BE1811D2FB00A70D03 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA66999D1811D2FA00A70D03 /* UIKit.framework */; };
EA6699C61811D2FB00A70D03 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA6699C41811D2FB00A70D03 /* InfoPlist.strings */; };
EA8B8AA41AC6683700638FBB /* SWGQueryParamCollection.m in Sources */ = {isa = PBXBuildFile; fileRef = EA8B8AA31AC6683700638FBB /* SWGQueryParamCollection.m */; };
EA8CD3ED1AC2763600C47D0B /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA8CD3EC1AC2763600C47D0B /* SenTestingKit.framework */; };
EAB26B091AC8DE24002F5C7A /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EAB26B081AC8DE24002F5C7A /* libPods.a */; };
EAB26B0C1AC8DF78002F5C7A /* PetApiTest.h in Sources */ = {isa = PBXBuildFile; fileRef = EA8CD3EB1AC274BE00C47D0B /* PetApiTest.h */; };
EAB26B0D1AC8DF78002F5C7A /* PetApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = EA6699C71811D2FB00A70D03 /* PetApiTest.m */; };
EAEA85E41811D3AE00F06E69 /* SWGApiClient.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85CD1811D3AE00F06E69 /* SWGApiClient.m */; };
EAEA85E51811D3AE00F06E69 /* SWGCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85CF1811D3AE00F06E69 /* SWGCategory.m */; };
EAEA85E71811D3AE00F06E69 /* SWGFile.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85D31811D3AE00F06E69 /* SWGFile.m */; };
EAEA85E81811D3AE00F06E69 /* SWGObject.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85D51811D3AE00F06E69 /* SWGObject.m */; };
EAEA85E91811D3AE00F06E69 /* SWGOrder.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85D71811D3AE00F06E69 /* SWGOrder.m */; };
EAEA85EA1811D3AE00F06E69 /* SWGPet.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85D91811D3AE00F06E69 /* SWGPet.m */; };
EAEA85EB1811D3AE00F06E69 /* SWGPetApi.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85DB1811D3AE00F06E69 /* SWGPetApi.m */; };
EAEA85EC1811D3AE00F06E69 /* SWGStoreApi.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85DD1811D3AE00F06E69 /* SWGStoreApi.m */; };
EAEA85ED1811D3AE00F06E69 /* SWGTag.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85DF1811D3AE00F06E69 /* SWGTag.m */; };
EAEA85EE1811D3AE00F06E69 /* SWGUser.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85E11811D3AE00F06E69 /* SWGUser.m */; };
EAEA85EF1811D3AE00F06E69 /* SWGUserApi.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85E31811D3AE00F06E69 /* SWGUserApi.m */; };
EAFBEABB1A925B8500A27431 /* test-1.png in Resources */ = {isa = PBXBuildFile; fileRef = EAFBEABA1A925B8500A27431 /* test-1.png */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
EA6699BF1811D2FB00A70D03 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = EA66998E1811D2FA00A70D03 /* Project object */;
proxyType = 1;
remoteGlobalIDString = EA6699951811D2FA00A70D03;
remoteInfo = PetstoreClient;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
73DA4F1067C343C3962F1542 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
A425648B5C0A4849C7668069 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "../Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
CF0560E91B1855CF00C0D4EC /* SWGConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGConfiguration.h; sourceTree = "<group>"; };
CF0560EA1B1855CF00C0D4EC /* SWGConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGConfiguration.m; sourceTree = "<group>"; };
CF31D0981B105E4B00509935 /* SWGApiClientTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGApiClientTest.m; sourceTree = "<group>"; };
CF5B6E2C1B2BD70800862A1C /* UserApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserApiTest.m; sourceTree = "<group>"; };
CFB37D051B2B11DC00D2E5F1 /* StoreApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StoreApiTest.m; sourceTree = "<group>"; };
CFCEFE4F1B2C1330006313BE /* SWGJSONResponseSerializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGJSONResponseSerializer.h; sourceTree = "<group>"; };
CFCEFE501B2C1330006313BE /* SWGJSONResponseSerializer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGJSONResponseSerializer.m; sourceTree = "<group>"; };
CFD1B66E1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "JSONValueTransformer+ISO8601.h"; sourceTree = "<group>"; };
CFD1B66F1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "JSONValueTransformer+ISO8601.m"; sourceTree = "<group>"; };
E2B6DA00BE52336E23783686 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "../Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
EA6699961811D2FA00A70D03 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; };
EA6699991811D2FA00A70D03 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
EA66999B1811D2FA00A70D03 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
EA66999D1811D2FA00A70D03 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
EA6699A11811D2FA00A70D03 /* SwaggerClient-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SwaggerClient-Info.plist"; sourceTree = "<group>"; };
EA6699A31811D2FA00A70D03 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
EA6699A51811D2FA00A70D03 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
EA6699A71811D2FA00A70D03 /* SwaggerClient-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SwaggerClient-Prefix.pch"; sourceTree = "<group>"; };
EA6699A81811D2FA00A70D03 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
EA6699A91811D2FA00A70D03 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
EA6699AC1811D2FA00A70D03 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = "<group>"; };
EA6699AF1811D2FA00A70D03 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = "<group>"; };
EA6699B11811D2FA00A70D03 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
EA6699B21811D2FA00A70D03 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
EA6699B41811D2FA00A70D03 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
EA6699BA1811D2FB00A70D03 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
EA6699C31811D2FB00A70D03 /* SwaggerClientTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SwaggerClientTests-Info.plist"; sourceTree = "<group>"; };
EA6699C51811D2FB00A70D03 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
EA6699C71811D2FB00A70D03 /* PetApiTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PetApiTest.m; sourceTree = "<group>"; };
EA8B8AA21AC6683700638FBB /* SWGQueryParamCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGQueryParamCollection.h; sourceTree = "<group>"; };
EA8B8AA31AC6683700638FBB /* SWGQueryParamCollection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGQueryParamCollection.m; sourceTree = "<group>"; };
EA8CD3EB1AC274BE00C47D0B /* PetApiTest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PetApiTest.h; sourceTree = "<group>"; };
EA8CD3EC1AC2763600C47D0B /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
EAB26B081AC8DE24002F5C7A /* libPods.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPods.a; path = "/Users/tony/dev/projects/swagger-api/swagger-codegen/samples/client/petstore/objc/Pods/../build/Debug-iphoneos/libPods.a"; sourceTree = "<absolute>"; };
EAB26B0E1AC8E692002F5C7A /* SWGPet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGPet.h; sourceTree = "<group>"; };
EAEA85CC1811D3AE00F06E69 /* SWGApiClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGApiClient.h; sourceTree = "<group>"; };
EAEA85CD1811D3AE00F06E69 /* SWGApiClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGApiClient.m; sourceTree = "<group>"; };
EAEA85CE1811D3AE00F06E69 /* SWGCategory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGCategory.h; sourceTree = "<group>"; };
EAEA85CF1811D3AE00F06E69 /* SWGCategory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGCategory.m; sourceTree = "<group>"; };
EAEA85D21811D3AE00F06E69 /* SWGFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGFile.h; sourceTree = "<group>"; };
EAEA85D31811D3AE00F06E69 /* SWGFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGFile.m; sourceTree = "<group>"; };
EAEA85D41811D3AE00F06E69 /* SWGObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGObject.h; sourceTree = "<group>"; };
EAEA85D51811D3AE00F06E69 /* SWGObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGObject.m; sourceTree = "<group>"; };
EAEA85D61811D3AE00F06E69 /* SWGOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGOrder.h; sourceTree = "<group>"; };
EAEA85D71811D3AE00F06E69 /* SWGOrder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGOrder.m; sourceTree = "<group>"; };
EAEA85D91811D3AE00F06E69 /* SWGPet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGPet.m; sourceTree = "<group>"; };
EAEA85DA1811D3AE00F06E69 /* SWGPetApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGPetApi.h; sourceTree = "<group>"; };
EAEA85DB1811D3AE00F06E69 /* SWGPetApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGPetApi.m; sourceTree = "<group>"; };
EAEA85DC1811D3AE00F06E69 /* SWGStoreApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGStoreApi.h; sourceTree = "<group>"; };
EAEA85DD1811D3AE00F06E69 /* SWGStoreApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGStoreApi.m; sourceTree = "<group>"; };
EAEA85DE1811D3AE00F06E69 /* SWGTag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGTag.h; sourceTree = "<group>"; };
EAEA85DF1811D3AE00F06E69 /* SWGTag.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGTag.m; sourceTree = "<group>"; };
EAEA85E01811D3AE00F06E69 /* SWGUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGUser.h; sourceTree = "<group>"; };
EAEA85E11811D3AE00F06E69 /* SWGUser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGUser.m; sourceTree = "<group>"; };
EAEA85E21811D3AE00F06E69 /* SWGUserApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGUserApi.h; sourceTree = "<group>"; };
EAEA85E31811D3AE00F06E69 /* SWGUserApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGUserApi.m; sourceTree = "<group>"; };
EAFBEABA1A925B8500A27431 /* test-1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "test-1.png"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
EA6699931811D2FA00A70D03 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
EA66999C1811D2FA00A70D03 /* CoreGraphics.framework in Frameworks */,
EA66999E1811D2FA00A70D03 /* UIKit.framework in Frameworks */,
EA66999A1811D2FA00A70D03 /* Foundation.framework in Frameworks */,
BA525648922D4C0E9F44D4F1 /* libPods.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
EA6699B71811D2FB00A70D03 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
EA8CD3ED1AC2763600C47D0B /* SenTestingKit.framework in Frameworks */,
EA6699BE1811D2FB00A70D03 /* UIKit.framework in Frameworks */,
EA6699BD1811D2FB00A70D03 /* Foundation.framework in Frameworks */,
EAB26B091AC8DE24002F5C7A /* libPods.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
1A15B3DE4358A178ABAEC251 /* Pods */ = {
isa = PBXGroup;
children = (
E2B6DA00BE52336E23783686 /* Pods.debug.xcconfig */,
A425648B5C0A4849C7668069 /* Pods.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
EA66998D1811D2FA00A70D03 = {
isa = PBXGroup;
children = (
EAEA85CB1811D3AE00F06E69 /* client */,
EA66999F1811D2FA00A70D03 /* SwaggerClient */,
EA6699C11811D2FB00A70D03 /* SwaggerClientTests */,
EA6699981811D2FA00A70D03 /* Frameworks */,
EA6699971811D2FA00A70D03 /* Products */,
1A15B3DE4358A178ABAEC251 /* Pods */,
);
sourceTree = "<group>";
};
EA6699971811D2FA00A70D03 /* Products */ = {
isa = PBXGroup;
children = (
EA6699961811D2FA00A70D03 /* SwaggerClient.app */,
EA6699BA1811D2FB00A70D03 /* SwaggerClientTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
EA6699981811D2FA00A70D03 /* Frameworks */ = {
isa = PBXGroup;
children = (
EAB26B081AC8DE24002F5C7A /* libPods.a */,
EA8CD3EC1AC2763600C47D0B /* SenTestingKit.framework */,
EA6699991811D2FA00A70D03 /* Foundation.framework */,
EA66999B1811D2FA00A70D03 /* CoreGraphics.framework */,
EA66999D1811D2FA00A70D03 /* UIKit.framework */,
73DA4F1067C343C3962F1542 /* libPods.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
EA66999F1811D2FA00A70D03 /* SwaggerClient */ = {
isa = PBXGroup;
children = (
EA6699A81811D2FA00A70D03 /* AppDelegate.h */,
EA6699A91811D2FA00A70D03 /* AppDelegate.m */,
EA6699AB1811D2FA00A70D03 /* Main_iPhone.storyboard */,
EA6699AE1811D2FA00A70D03 /* Main_iPad.storyboard */,
EA6699B11811D2FA00A70D03 /* ViewController.h */,
EA6699B21811D2FA00A70D03 /* ViewController.m */,
EA6699B41811D2FA00A70D03 /* Images.xcassets */,
EA6699A01811D2FA00A70D03 /* Supporting Files */,
);
path = SwaggerClient;
sourceTree = "<group>";
};
EA6699A01811D2FA00A70D03 /* Supporting Files */ = {
isa = PBXGroup;
children = (
EAFBEABA1A925B8500A27431 /* test-1.png */,
EA6699A11811D2FA00A70D03 /* SwaggerClient-Info.plist */,
EA6699A21811D2FA00A70D03 /* InfoPlist.strings */,
EA6699A51811D2FA00A70D03 /* main.m */,
EA6699A71811D2FA00A70D03 /* SwaggerClient-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
EA6699C11811D2FB00A70D03 /* SwaggerClientTests */ = {
isa = PBXGroup;
children = (
EA8CD3EB1AC274BE00C47D0B /* PetApiTest.h */,
CF5B6E2C1B2BD70800862A1C /* UserApiTest.m */,
CFB37D051B2B11DC00D2E5F1 /* StoreApiTest.m */,
CF31D0981B105E4B00509935 /* SWGApiClientTest.m */,
EA6699C71811D2FB00A70D03 /* PetApiTest.m */,
EA6699C21811D2FB00A70D03 /* Supporting Files */,
);
path = SwaggerClientTests;
sourceTree = "<group>";
};
EA6699C21811D2FB00A70D03 /* Supporting Files */ = {
isa = PBXGroup;
children = (
EA6699C31811D2FB00A70D03 /* SwaggerClientTests-Info.plist */,
EA6699C41811D2FB00A70D03 /* InfoPlist.strings */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
EAEA85CB1811D3AE00F06E69 /* client */ = {
isa = PBXGroup;
children = (
CFD1B66E1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.h */,
CFD1B66F1B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m */,
EA8B8AA21AC6683700638FBB /* SWGQueryParamCollection.h */,
EA8B8AA31AC6683700638FBB /* SWGQueryParamCollection.m */,
EAEA85CC1811D3AE00F06E69 /* SWGApiClient.h */,
EAEA85CD1811D3AE00F06E69 /* SWGApiClient.m */,
CF0560E91B1855CF00C0D4EC /* SWGConfiguration.h */,
CF0560EA1B1855CF00C0D4EC /* SWGConfiguration.m */,
EAEA85CE1811D3AE00F06E69 /* SWGCategory.h */,
EAEA85CF1811D3AE00F06E69 /* SWGCategory.m */,
EAEA85D21811D3AE00F06E69 /* SWGFile.h */,
EAEA85D31811D3AE00F06E69 /* SWGFile.m */,
EAEA85D41811D3AE00F06E69 /* SWGObject.h */,
EAEA85D51811D3AE00F06E69 /* SWGObject.m */,
EAEA85D61811D3AE00F06E69 /* SWGOrder.h */,
EAEA85D71811D3AE00F06E69 /* SWGOrder.m */,
EAB26B0E1AC8E692002F5C7A /* SWGPet.h */,
CFCEFE4F1B2C1330006313BE /* SWGJSONResponseSerializer.h */,
CFCEFE501B2C1330006313BE /* SWGJSONResponseSerializer.m */,
EAEA85D91811D3AE00F06E69 /* SWGPet.m */,
EAEA85DA1811D3AE00F06E69 /* SWGPetApi.h */,
EAEA85DB1811D3AE00F06E69 /* SWGPetApi.m */,
EAEA85DC1811D3AE00F06E69 /* SWGStoreApi.h */,
EAEA85DD1811D3AE00F06E69 /* SWGStoreApi.m */,
EAEA85DE1811D3AE00F06E69 /* SWGTag.h */,
EAEA85DF1811D3AE00F06E69 /* SWGTag.m */,
EAEA85E01811D3AE00F06E69 /* SWGUser.h */,
EAEA85E11811D3AE00F06E69 /* SWGUser.m */,
EAEA85E21811D3AE00F06E69 /* SWGUserApi.h */,
EAEA85E31811D3AE00F06E69 /* SWGUserApi.m */,
);
name = client;
path = ../client;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
EA6699951811D2FA00A70D03 /* SwaggerClient */ = {
isa = PBXNativeTarget;
buildConfigurationList = EA6699CB1811D2FB00A70D03 /* Build configuration list for PBXNativeTarget "SwaggerClient" */;
buildPhases = (
04DAA264FD78471BBAD25173 /* Check Pods Manifest.lock */,
EA6699921811D2FA00A70D03 /* Sources */,
EA6699931811D2FA00A70D03 /* Frameworks */,
3692D11BB04F489DAA7C0B6A /* Copy Pods Resources */,
EA6699941811D2FA00A70D03 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = SwaggerClient;
productName = PetstoreClient;
productReference = EA6699961811D2FA00A70D03 /* SwaggerClient.app */;
productType = "com.apple.product-type.application";
};
EA6699B91811D2FB00A70D03 /* SwaggerClientTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = EA6699CE1811D2FB00A70D03 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */;
buildPhases = (
EA6699B61811D2FB00A70D03 /* Sources */,
EA6699B71811D2FB00A70D03 /* Frameworks */,
EA6699B81811D2FB00A70D03 /* Resources */,
);
buildRules = (
);
dependencies = (
EA6699C01811D2FB00A70D03 /* PBXTargetDependency */,
);
name = SwaggerClientTests;
productName = PetstoreClientTests;
productReference = EA6699BA1811D2FB00A70D03 /* SwaggerClientTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
EA66998E1811D2FA00A70D03 /* Project object */ = {
isa = PBXProject;
attributes = {
LastTestingUpgradeCheck = 0620;
LastUpgradeCheck = 0500;
ORGANIZATIONNAME = Reverb;
TargetAttributes = {
EA6699B91811D2FB00A70D03 = {
TestTargetID = EA6699951811D2FA00A70D03;
};
};
};
buildConfigurationList = EA6699911811D2FA00A70D03 /* Build configuration list for PBXProject "SwaggerClient" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = EA66998D1811D2FA00A70D03;
productRefGroup = EA6699971811D2FA00A70D03 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
EA6699951811D2FA00A70D03 /* SwaggerClient */,
EA6699B91811D2FB00A70D03 /* SwaggerClientTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
EA6699941811D2FA00A70D03 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
EA6699B01811D2FA00A70D03 /* Main_iPad.storyboard in Resources */,
EA6699B51811D2FA00A70D03 /* Images.xcassets in Resources */,
EA6699AD1811D2FA00A70D03 /* Main_iPhone.storyboard in Resources */,
EAFBEABB1A925B8500A27431 /* test-1.png in Resources */,
EA6699A41811D2FA00A70D03 /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
EA6699B81811D2FB00A70D03 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
EA6699C61811D2FB00A70D03 /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
04DAA264FD78471BBAD25173 /* Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
3692D11BB04F489DAA7C0B6A /* Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
EA6699921811D2FA00A70D03 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
EAEA85E51811D3AE00F06E69 /* SWGCategory.m in Sources */,
CF0560EB1B1855CF00C0D4EC /* SWGConfiguration.m in Sources */,
EAEA85ED1811D3AE00F06E69 /* SWGTag.m in Sources */,
EA6699B31811D2FA00A70D03 /* ViewController.m in Sources */,
EA6699AA1811D2FA00A70D03 /* AppDelegate.m in Sources */,
EAEA85EE1811D3AE00F06E69 /* SWGUser.m in Sources */,
EAEA85EF1811D3AE00F06E69 /* SWGUserApi.m in Sources */,
EAEA85EB1811D3AE00F06E69 /* SWGPetApi.m in Sources */,
EA6699A61811D2FA00A70D03 /* main.m in Sources */,
CFD1B6701B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m in Sources */,
EAEA85EA1811D3AE00F06E69 /* SWGPet.m in Sources */,
EAEA85E41811D3AE00F06E69 /* SWGApiClient.m in Sources */,
EAEA85EC1811D3AE00F06E69 /* SWGStoreApi.m in Sources */,
EAEA85E91811D3AE00F06E69 /* SWGOrder.m in Sources */,
EAEA85E81811D3AE00F06E69 /* SWGObject.m in Sources */,
EA8B8AA41AC6683700638FBB /* SWGQueryParamCollection.m in Sources */,
CFCEFE511B2C1330006313BE /* SWGJSONResponseSerializer.m in Sources */,
EAEA85E71811D3AE00F06E69 /* SWGFile.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
EA6699B61811D2FB00A70D03 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
EAB26B0C1AC8DF78002F5C7A /* PetApiTest.h in Sources */,
CFD1B6711B05EC7D00DCCD51 /* JSONValueTransformer+ISO8601.m in Sources */,
EAB26B0D1AC8DF78002F5C7A /* PetApiTest.m in Sources */,
CF5B6E2D1B2BD70800862A1C /* UserApiTest.m in Sources */,
CFB37D061B2B11DD00D2E5F1 /* StoreApiTest.m in Sources */,
CF31D0991B105E4B00509935 /* SWGApiClientTest.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
EA6699C01811D2FB00A70D03 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = EA6699951811D2FA00A70D03 /* SwaggerClient */;
targetProxy = EA6699BF1811D2FB00A70D03 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
EA6699A21811D2FA00A70D03 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
EA6699A31811D2FA00A70D03 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
EA6699AB1811D2FA00A70D03 /* Main_iPhone.storyboard */ = {
isa = PBXVariantGroup;
children = (
EA6699AC1811D2FA00A70D03 /* Base */,
);
name = Main_iPhone.storyboard;
sourceTree = "<group>";
};
EA6699AE1811D2FA00A70D03 /* Main_iPad.storyboard */ = {
isa = PBXVariantGroup;
children = (
EA6699AF1811D2FA00A70D03 /* Base */,
);
name = Main_iPad.storyboard;
sourceTree = "<group>";
};
EA6699C41811D2FB00A70D03 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
EA6699C51811D2FB00A70D03 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
EA6699C91811D2FB00A70D03 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
EA6699CA1811D2FB00A70D03 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
EA6699CC1811D2FB00A70D03 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E2B6DA00BE52336E23783686 /* Pods.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch";
INFOPLIST_FILE = "SwaggerClient/SwaggerClient-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/tony/dev/projects/swagger-api/swagger-codegen/samples/client/petstore/objc/Pods/../build/Debug-iphoneos",
);
PRODUCT_NAME = SwaggerClient;
WRAPPER_EXTENSION = app;
};
name = Debug;
};
EA6699CD1811D2FB00A70D03 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A425648B5C0A4849C7668069 /* Pods.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch";
INFOPLIST_FILE = "SwaggerClient/SwaggerClient-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/tony/dev/projects/swagger-api/swagger-codegen/samples/client/petstore/objc/Pods/../build/Debug-iphoneos",
);
PRODUCT_NAME = SwaggerClient;
WRAPPER_EXTENSION = app;
};
name = Release;
};
EA6699CF1811D2FB00A70D03 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E2B6DA00BE52336E23783686 /* Pods.debug.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = "SwaggerClientTests/SwaggerClientTests-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/tony/dev/projects/swagger-api/swagger-codegen/samples/client/petstore/objc/Pods/../build/Debug-iphoneos",
);
PRODUCT_NAME = SwaggerClientTests;
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
};
name = Debug;
};
EA6699D01811D2FB00A70D03 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A425648B5C0A4849C7668069 /* Pods.release.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch";
INFOPLIST_FILE = "SwaggerClientTests/SwaggerClientTests-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/tony/dev/projects/swagger-api/swagger-codegen/samples/client/petstore/objc/Pods/../build/Debug-iphoneos",
);
PRODUCT_NAME = SwaggerClientTests;
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
EA6699911811D2FA00A70D03 /* Build configuration list for PBXProject "SwaggerClient" */ = {
isa = XCConfigurationList;
buildConfigurations = (
EA6699C91811D2FB00A70D03 /* Debug */,
EA6699CA1811D2FB00A70D03 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
EA6699CB1811D2FB00A70D03 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = {
isa = XCConfigurationList;
buildConfigurations = (
EA6699CC1811D2FB00A70D03 /* Debug */,
EA6699CD1811D2FB00A70D03 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
EA6699CE1811D2FB00A70D03 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
EA6699CF1811D2FB00A70D03 /* Debug */,
EA6699D01811D2FB00A70D03 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = EA66998E1811D2FA00A70D03 /* Project object */;
}

View File

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>7A33CEA3-5D3F-4B6D-8F47-84701AB3E283</string>
<key>IDESourceControlProjectName</key>
<string>PetstoreClient</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>92840518-904D-4771-AA3D-9AF52CA48B71</key>
<string>ssh://github.com/wordnik/swagger-codegen.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>samples/client/petstore/objc/PetstoreClient/PetstoreClient.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>92840518-904D-4771-AA3D-9AF52CA48B71</key>
<string>../../../../../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>ssh://github.com/wordnik/swagger-codegen.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>92840518-904D-4771-AA3D-9AF52CA48B71</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>92840518-904D-4771-AA3D-9AF52CA48B71</string>
<key>IDESourceControlWCCName</key>
<string>swagger-codegen</string>
</dict>
</array>
</dict>
</plist>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>SwaggerClient.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>4</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>EA6699951811D2FA00A70D03</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>EA6699B91811D2FB00A70D03</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@ -1,98 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699951811D2FA00A70D03"
BuildableName = "PetstoreClient.app"
BlueprintName = "PetstoreClient"
ReferencedContainer = "container:PetstoreClient.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699B91811D2FB00A70D03"
BuildableName = "PetstoreClientTests.xctest"
BlueprintName = "PetstoreClientTests"
ReferencedContainer = "container:PetstoreClient.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699951811D2FA00A70D03"
BuildableName = "PetstoreClient.app"
BlueprintName = "PetstoreClient"
ReferencedContainer = "container:PetstoreClient.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699951811D2FA00A70D03"
BuildableName = "PetstoreClient.app"
BlueprintName = "PetstoreClient"
ReferencedContainer = "container:PetstoreClient.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699951811D2FA00A70D03"
BuildableName = "PetstoreClient.app"
BlueprintName = "PetstoreClient"
ReferencedContainer = "container:PetstoreClient.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,15 +0,0 @@
//
// AppDelegate.h
// PetstoreClient
//
// Created by Tony Tam on 10/18/13.
// Copyright (c) 2015 SmartBear Software. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4451" systemVersion="13A461" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3676"/>
</dependencies>
<scenes>
<!--class Prefix:identifier View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="20" width="768" height="1004"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackOpaque"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4451" systemVersion="13A461" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3676"/>
</dependencies>
<scenes>
<!--class Prefix:identifier View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="ViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>

View File

@ -1,58 +0,0 @@
{
"images": [
{
"idiom": "iphone",
"size": "29x29",
"scale": "2x"
},
{
"idiom": "iphone",
"size": "40x40",
"scale": "2x"
},
{
"idiom": "iphone",
"size": "60x60",
"scale": "2x"
},
{
"idiom": "iphone",
"size": "60x60",
"scale": "3x"
},
{
"idiom": "ipad",
"size": "29x29",
"scale": "1x"
},
{
"idiom": "ipad",
"size": "29x29",
"scale": "2x"
},
{
"idiom": "ipad",
"size": "40x40",
"scale": "1x"
},
{
"idiom": "ipad",
"size": "40x40",
"scale": "2x"
},
{
"idiom": "ipad",
"size": "76x76",
"scale": "1x"
},
{
"idiom": "ipad",
"size": "76x76",
"scale": "2x"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

View File

@ -1,51 +0,0 @@
{
"images": [
{
"orientation": "portrait",
"idiom": "iphone",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "2x"
},
{
"orientation": "portrait",
"idiom": "iphone",
"subtype": "retina4",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "2x"
},
{
"orientation": "portrait",
"idiom": "ipad",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "1x"
},
{
"orientation": "landscape",
"idiom": "ipad",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "1x"
},
{
"orientation": "portrait",
"idiom": "ipad",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "2x"
},
{
"orientation": "landscape",
"idiom": "ipad",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "2x"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

View File

@ -1,13 +0,0 @@
//
// ViewController.h
// PetstoreClient
//
// Created by Tony Tam on 10/18/13.
// Copyright (c) 2015 SmartBear Software. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end

View File

@ -1,75 +0,0 @@
//
// ViewController.m
// PetstoreClient
//
// Created by Tony Tam on 10/18/13.
// Copyright (c) 2015 SmartBear Software. All rights reserved.
//
#import "ViewController.h"
#import "SWGPetApi.h"
#import "SWGStoreApi.h"
#import "SWGUserApi.h"
#import "SWGConfiguration.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
/*
SWGPetApi * api = [[SWGPetApi alloc] init];
[api getPetByIdWithCompletionBlock:@10 completionHandler:^(SWGPet *output, NSError *error) {
NSLog(@"%@", [output asDictionary]);
[output set_id:@101];
[api addPetWithCompletionBlock:output completionHandler:^(NSError *error) {
NSLog(@"Done!");
}];
// load data into file
}];
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"test-1" ofType:@"png"];
NSData *myData = [NSData dataWithContentsOfFile:filePath];
SWGFile *file = [[SWGFile alloc] initWithNameData:@"test-2.png" mimeType:@"image/png" data:myData];
[api uploadFileWithCompletionBlock:@1
additionalMetadata:@"some metadata"
file:file
completionHandler:^(NSError *error) {
if(error) {
NSLog(@"%@", error);
}
}
// completionHandler:^(SWGApiResponse *output, NSError *error) {
// if(error) {
// NSLog(@"%@", error);
// }
// else {
// NSLog(@"%@", [output asDictionary]);
// }
// }
];
*/
SWGPetApi *api = [[SWGPetApi alloc] init];
[api deletePetWithCompletionBlock:@"hello"
petId:@1434529787992
completionHandler:^(NSError *error) {
if (error) {
NSLog(@"%@", error);
}
}];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end

View File

@ -1,18 +0,0 @@
//
// main.m
// PetstoreClient
//
// Created by Tony Tam on 10/18/13.
// Copyright (c) 2015 SmartBear Software. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 717 KiB

View File

@ -1,9 +0,0 @@
#import <XCTest/XCTest.h>
#import "SWGPetApi.h"
@interface PetApiTest : XCTestCase {
@private
SWGPetApi * api;
}
@end

View File

@ -1,24 +0,0 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>de.felixschulze.my-project</groupId>
<artifactId>PetstoreClient</artifactId>
<packaging>xcode</packaging>
<version>1.0-SNAPSHOT</version>
<name>Swagger Petstore Client</name>
<build>
<plugins>
<plugin>
<groupId>de.felixschulze.maven.plugins.xcode</groupId>
<artifactId>xcode-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<xcodeProject>PetstoreClient.xcodeproj</xcodeProject>
<xcodeTarget>PetstoreClient</xcodeTarget>
<xcodeConfiguration>Debug</xcodeConfiguration>
<xcodeSdk>iphoneos</xcodeSdk>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,12 @@
source 'https://github.com/CocoaPods/Specs.git'
target 'SwaggerClient_Example', :exclusive => true do
pod "SwaggerClient", :path => "../"
end
target 'SwaggerClient_Tests', :exclusive => true do
pod "SwaggerClient", :path => "../"
pod 'Specta'
pod 'Expecta'
end

View File

@ -0,0 +1,587 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
158CE3AA214CB1B31C7ADC48 /* libPods-SwaggerClient_Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */; };
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; };
6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; };
6003F59E195388D20070C39A /* SWGAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* SWGAppDelegate.m */; };
6003F5A7195388D20070C39A /* SWGViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* SWGViewController.m */; };
6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; };
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; };
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; };
6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; };
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
94BE6BE84795B5034A811E61 /* libPods-SwaggerClient_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */; };
CFDFB4121B3CFFA8009739C5 /* UserApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFDFB40D1B3CFEC3009739C5 /* UserApiTest.m */; };
CFDFB4131B3CFFDD009739C5 /* PetApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFDFB40A1B3CFEC3009739C5 /* PetApiTest.m */; };
CFDFB4141B3CFFF6009739C5 /* StoreApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFDFB40B1B3CFEC3009739C5 /* StoreApiTest.m */; };
CFDFB4151B3D000B009739C5 /* SWGApiClientTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFDFB40C1B3CFEC3009739C5 /* SWGApiClientTest.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6003F582195388D10070C39A /* Project object */;
proxyType = 1;
remoteGlobalIDString = 6003F589195388D20070C39A;
remoteInfo = SwaggerClient;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.release.xcconfig"; sourceTree = "<group>"; };
4CCE21315897B7D544C83242 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
6003F58A195388D20070C39A /* SwaggerClient_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
6003F595195388D20070C39A /* SwaggerClient-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SwaggerClient-Info.plist"; sourceTree = "<group>"; };
6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
6003F59B195388D20070C39A /* SwaggerClient-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SwaggerClient-Prefix.pch"; sourceTree = "<group>"; };
6003F59C195388D20070C39A /* SWGAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWGAppDelegate.h; sourceTree = "<group>"; };
6003F59D195388D20070C39A /* SWGAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWGAppDelegate.m; sourceTree = "<group>"; };
6003F5A5195388D20070C39A /* SWGViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWGViewController.h; sourceTree = "<group>"; };
6003F5A6195388D20070C39A /* SWGViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWGViewController.m; sourceTree = "<group>"; };
6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClient_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = "<group>"; };
6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; };
606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; };
73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.debug.xcconfig"; sourceTree = "<group>"; };
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwaggerClient_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example.release.xcconfig"; sourceTree = "<group>"; };
CFDFB40A1B3CFEC3009739C5 /* PetApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PetApiTest.m; sourceTree = "<group>"; };
CFDFB40B1B3CFEC3009739C5 /* StoreApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StoreApiTest.m; sourceTree = "<group>"; };
CFDFB40C1B3CFEC3009739C5 /* SWGApiClientTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGApiClientTest.m; sourceTree = "<group>"; };
CFDFB40D1B3CFEC3009739C5 /* UserApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserApiTest.m; sourceTree = "<group>"; };
E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example.debug.xcconfig"; sourceTree = "<group>"; };
E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SwaggerClient.podspec; path = ../SwaggerClient.podspec; sourceTree = "<group>"; };
FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwaggerClient_Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
6003F587195388D20070C39A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */,
6003F592195388D20070C39A /* UIKit.framework in Frameworks */,
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */,
94BE6BE84795B5034A811E61 /* libPods-SwaggerClient_Example.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
6003F5AB195388D20070C39A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */,
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */,
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */,
158CE3AA214CB1B31C7ADC48 /* libPods-SwaggerClient_Tests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6003F581195388D10070C39A = {
isa = PBXGroup;
children = (
60FF7A9C1954A5C5007DD14C /* Podspec Metadata */,
6003F593195388D20070C39A /* Example for SwaggerClient */,
6003F5B5195388D20070C39A /* Tests */,
6003F58C195388D20070C39A /* Frameworks */,
6003F58B195388D20070C39A /* Products */,
CCE77F10C6D41F74B075ECD0 /* Pods */,
);
sourceTree = "<group>";
};
6003F58B195388D20070C39A /* Products */ = {
isa = PBXGroup;
children = (
6003F58A195388D20070C39A /* SwaggerClient_Example.app */,
6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
6003F58C195388D20070C39A /* Frameworks */ = {
isa = PBXGroup;
children = (
6003F58D195388D20070C39A /* Foundation.framework */,
6003F58F195388D20070C39A /* CoreGraphics.framework */,
6003F591195388D20070C39A /* UIKit.framework */,
6003F5AF195388D20070C39A /* XCTest.framework */,
8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */,
FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
6003F593195388D20070C39A /* Example for SwaggerClient */ = {
isa = PBXGroup;
children = (
6003F59C195388D20070C39A /* SWGAppDelegate.h */,
6003F59D195388D20070C39A /* SWGAppDelegate.m */,
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */,
6003F5A5195388D20070C39A /* SWGViewController.h */,
6003F5A6195388D20070C39A /* SWGViewController.m */,
6003F5A8195388D20070C39A /* Images.xcassets */,
6003F594195388D20070C39A /* Supporting Files */,
);
name = "Example for SwaggerClient";
path = SwaggerClient;
sourceTree = "<group>";
};
6003F594195388D20070C39A /* Supporting Files */ = {
isa = PBXGroup;
children = (
6003F595195388D20070C39A /* SwaggerClient-Info.plist */,
6003F596195388D20070C39A /* InfoPlist.strings */,
6003F599195388D20070C39A /* main.m */,
6003F59B195388D20070C39A /* SwaggerClient-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
6003F5B5195388D20070C39A /* Tests */ = {
isa = PBXGroup;
children = (
CFDFB40A1B3CFEC3009739C5 /* PetApiTest.m */,
CFDFB40B1B3CFEC3009739C5 /* StoreApiTest.m */,
CFDFB40C1B3CFEC3009739C5 /* SWGApiClientTest.m */,
CFDFB40D1B3CFEC3009739C5 /* UserApiTest.m */,
6003F5BB195388D20070C39A /* Tests.m */,
6003F5B6195388D20070C39A /* Supporting Files */,
);
path = Tests;
sourceTree = "<group>";
};
6003F5B6195388D20070C39A /* Supporting Files */ = {
isa = PBXGroup;
children = (
6003F5B7195388D20070C39A /* Tests-Info.plist */,
6003F5B8195388D20070C39A /* InfoPlist.strings */,
606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = {
isa = PBXGroup;
children = (
E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */,
4CCE21315897B7D544C83242 /* README.md */,
);
name = "Podspec Metadata";
sourceTree = "<group>";
};
CCE77F10C6D41F74B075ECD0 /* Pods */ = {
isa = PBXGroup;
children = (
E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */,
BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */,
73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */,
1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
6003F589195388D20070C39A /* SwaggerClient_Example */ = {
isa = PBXNativeTarget;
buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Example" */;
buildPhases = (
799E7E29D924C30424DFBA28 /* Check Pods Manifest.lock */,
6003F586195388D20070C39A /* Sources */,
6003F587195388D20070C39A /* Frameworks */,
6003F588195388D20070C39A /* Resources */,
429AF5C69E165ED75311B4B0 /* Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = SwaggerClient_Example;
productName = SwaggerClient;
productReference = 6003F58A195388D20070C39A /* SwaggerClient_Example.app */;
productType = "com.apple.product-type.application";
};
6003F5AD195388D20070C39A /* SwaggerClient_Tests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Tests" */;
buildPhases = (
7B069562A9F91E498732474F /* Check Pods Manifest.lock */,
6003F5AA195388D20070C39A /* Sources */,
6003F5AB195388D20070C39A /* Frameworks */,
6003F5AC195388D20070C39A /* Resources */,
E337D7E459CCFFDF27046FFC /* Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
6003F5B4195388D20070C39A /* PBXTargetDependency */,
);
name = SwaggerClient_Tests;
productName = SwaggerClientTests;
productReference = 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
6003F582195388D10070C39A /* Project object */ = {
isa = PBXProject;
attributes = {
CLASSPREFIX = SWG;
LastUpgradeCheck = 0510;
ORGANIZATIONNAME = geekerzp;
};
buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "SwaggerClient" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 6003F581195388D10070C39A;
productRefGroup = 6003F58B195388D20070C39A /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
6003F589195388D20070C39A /* SwaggerClient_Example */,
6003F5AD195388D20070C39A /* SwaggerClient_Tests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
6003F588195388D20070C39A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */,
6003F5A9195388D20070C39A /* Images.xcassets in Resources */,
6003F598195388D20070C39A /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
6003F5AC195388D20070C39A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
429AF5C69E165ED75311B4B0 /* Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
799E7E29D924C30424DFBA28 /* Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
7B069562A9F91E498732474F /* Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
E337D7E459CCFFDF27046FFC /* Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
6003F586195388D20070C39A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6003F59E195388D20070C39A /* SWGAppDelegate.m in Sources */,
6003F5A7195388D20070C39A /* SWGViewController.m in Sources */,
6003F59A195388D20070C39A /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
6003F5AA195388D20070C39A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CFDFB4141B3CFFF6009739C5 /* StoreApiTest.m in Sources */,
CFDFB4131B3CFFDD009739C5 /* PetApiTest.m in Sources */,
6003F5BC195388D20070C39A /* Tests.m in Sources */,
CFDFB4151B3D000B009739C5 /* SWGApiClientTest.m in Sources */,
CFDFB4121B3CFFA8009739C5 /* UserApiTest.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
6003F5B4195388D20070C39A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 6003F589195388D20070C39A /* SwaggerClient_Example */;
targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
6003F596195388D20070C39A /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
6003F597195388D20070C39A /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
6003F5B8195388D20070C39A /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
6003F5B9195388D20070C39A /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
6003F5BD195388D20070C39A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
6003F5BE195388D20070C39A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
6003F5C0195388D20070C39A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch";
INFOPLIST_FILE = "SwaggerClient/SwaggerClient-Info.plist";
MODULE_NAME = ExampleApp;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
6003F5C1195388D20070C39A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch";
INFOPLIST_FILE = "SwaggerClient/SwaggerClient-Info.plist";
MODULE_NAME = ExampleApp;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Release;
};
6003F5C3195388D20070C39A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = "Tests/Tests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = xctest;
};
name = Debug;
};
6003F5C4195388D20070C39A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch";
INFOPLIST_FILE = "Tests/Tests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = xctest;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
6003F585195388D10070C39A /* Build configuration list for PBXProject "SwaggerClient" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6003F5BD195388D20070C39A /* Debug */,
6003F5BE195388D20070C39A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Example" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6003F5C0195388D20070C39A /* Debug */,
6003F5C1195388D20070C39A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Tests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6003F5C3195388D20070C39A /* Debug */,
6003F5C4195388D20070C39A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 6003F582195388D10070C39A /* Project object */;
}

View File

@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "self:PetstoreClient.xcodeproj">
location = "self:SwaggerClient.xcodeproj">
</FileRef>
</Workspace>

View File

@ -5,7 +5,7 @@
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>15AAFA18-9D61-437F-988D-A691BA4C08B1</string>
<string>303FE0A9-4715-4C57-8D01-F604EF82CF6D</string>
<key>IDESourceControlProjectName</key>
<string>SwaggerClient</string>
<key>IDESourceControlProjectOriginsDictionary</key>
@ -14,11 +14,11 @@
<string>https://github.com/geekerzp/swagger-codegen.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>samples/client/petstore/objc/SwaggerClient.xcworkspace</string>
<string>samples/client/petstore/objc/SwaggerClientTests/SwaggerClient.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>E5BBF0AA85077C865C95437976D06D819733A208</key>
<string>../../../../..</string>
<string>../../../../../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/geekerzp/swagger-codegen.git</string>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -14,23 +14,9 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699951811D2FA00A70D03"
BuildableName = "SwaggerClient.app"
BlueprintName = "SwaggerClient"
ReferencedContainer = "container:SwaggerClient.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699B91811D2FB00A70D03"
BuildableName = "SwaggerClientTests.xctest"
BlueprintName = "SwaggerClientTests"
BlueprintIdentifier = "6003F589195388D20070C39A"
BuildableName = "SwaggerClient_Example.app"
BlueprintName = "SwaggerClient_Example"
ReferencedContainer = "container:SwaggerClient.xcodeproj">
</BuildableReference>
</BuildActionEntry>
@ -46,9 +32,9 @@
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699B91811D2FB00A70D03"
BuildableName = "SwaggerClientTests.xctest"
BlueprintName = "SwaggerClientTests"
BlueprintIdentifier = "6003F5AD195388D20070C39A"
BuildableName = "SwaggerClient_Tests.xctest"
BlueprintName = "SwaggerClient_Tests"
ReferencedContainer = "container:SwaggerClient.xcodeproj">
</BuildableReference>
</TestableReference>
@ -56,9 +42,9 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699951811D2FA00A70D03"
BuildableName = "SwaggerClient.app"
BlueprintName = "SwaggerClient"
BlueprintIdentifier = "6003F589195388D20070C39A"
BuildableName = "SwaggerClient_Example.app"
BlueprintName = "SwaggerClient_Example"
ReferencedContainer = "container:SwaggerClient.xcodeproj">
</BuildableReference>
</MacroExpansion>
@ -76,9 +62,9 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699951811D2FA00A70D03"
BuildableName = "SwaggerClient.app"
BlueprintName = "SwaggerClient"
BlueprintIdentifier = "6003F589195388D20070C39A"
BuildableName = "SwaggerClient_Example.app"
BlueprintName = "SwaggerClient_Example"
ReferencedContainer = "container:SwaggerClient.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
@ -95,9 +81,9 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA6699951811D2FA00A70D03"
BuildableName = "SwaggerClient.app"
BlueprintName = "SwaggerClient"
BlueprintIdentifier = "6003F589195388D20070C39A"
BuildableName = "SwaggerClient_Example.app"
BlueprintName = "SwaggerClient_Example"
ReferencedContainer = "container:SwaggerClient.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>

View File

@ -2,22 +2,14 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>PetstoreClient.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>EA6699951811D2FA00A70D03</key>
<key>6003F589195388D20070C39A</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>EA6699B91811D2FB00A70D03</key>
<key>6003F5AD195388D20070C39A</key>
<dict>
<key>primary</key>
<true/>

View File

@ -0,0 +1,53 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,51 @@
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"subtype" : "retina4",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="whP-gf-Uak">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="wQg-tq-qST">
<objects>
<viewController id="whP-gf-Uak" customClass="SWGViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="uEw-UM-LJ8"/>
<viewControllerLayoutGuide type="bottom" id="Mvr-aV-6Um"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="TpU-gO-2f1">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="tc2-Qw-aMS" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="305" y="433"/>
</scene>
</scenes>
</document>

View File

@ -0,0 +1,15 @@
//
// SWGAppDelegate.h
// SwaggerClient
//
// Created by CocoaPods on 06/26/2015.
// Copyright (c) 2014 geekerzp. All rights reserved.
//
@import UIKit;
@interface SWGAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end

View File

@ -1,14 +1,14 @@
//
// AppDelegate.m
// PetstoreClient
// SWGAppDelegate.m
// SwaggerClient
//
// Created by Tony Tam on 10/18/13.
// Copyright (c) 2015 SmartBear Software. All rights reserved.
// Created by CocoaPods on 06/26/2015.
// Copyright (c) 2014 geekerzp. All rights reserved.
//
#import "AppDelegate.h"
#import "SWGAppDelegate.h"
@implementation AppDelegate
@implementation SWGAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

View File

@ -0,0 +1,13 @@
//
// SWGViewController.h
// SwaggerClient
//
// Created by geekerzp on 06/26/2015.
// Copyright (c) 2014 geekerzp. All rights reserved.
//
@import UIKit;
@interface SWGViewController : UIViewController
@end

View File

@ -0,0 +1,29 @@
//
// SWGViewController.m
// SwaggerClient
//
// Created by geekerzp on 06/26/2015.
// Copyright (c) 2014 geekerzp. All rights reserved.
//
#import "SWGViewController.h"
@interface SWGViewController ()
@end
@implementation SWGViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end

View File

@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.reverb.${PRODUCT_NAME:rfc1034identifier}</string>
<string>org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@ -25,9 +25,7 @@
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>Main_iPhone</string>
<key>UIMainStoryboardFile~ipad</key>
<string>Main_iPad</string>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>

View File

@ -11,7 +11,6 @@
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <SystemConfiguration/SystemConfiguration.h>
@import UIKit;
@import Foundation;
#endif

View File

@ -0,0 +1,17 @@
//
// main.m
// SwaggerClient
//
// Created by geekerzp on 06/26/2015.
// Copyright (c) 2014 geekerzp. All rights reserved.
//
@import UIKit;
#import "SWGAppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([SWGAppDelegate class]));
}
}

View File

@ -1,5 +1,14 @@
#import "PetApiTest.h"
#import "SWGFile.h"
#import <XCTest/XCTest.h>
#import <SwaggerClient/SWGApiClient.h>
#import <SwaggerClient/SWGPetApi.h>
#import <SwaggerClient/SWGPet.h>
@interface PetApiTest : XCTestCase {
@private
SWGPetApi * api;
}
@end
@implementation PetApiTest
@ -190,7 +199,7 @@
if(error){
XCTFail(@"got error %@", error);
}
[api deletePetWithCompletionBlock:@"" petId:[NSString stringWithFormat:@"%@", [pet _id]] completionHandler:^(NSError *error) {
[api deletePetWithCompletionBlock:pet._id apiKey:@"" completionHandler:^(NSError *error) {
if(error){
XCTFail(@"got error %@", error);
}
@ -210,14 +219,11 @@
}
- (void)testUploadFile {
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadFile"];
NSString* str = @"teststring";
NSData* data = [str dataUsingEncoding:NSUTF8StringEncoding];
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithFile"];
SWGFile * file = [[SWGFile alloc] initWithNameData: @"myFile.txt" mimeType:@"text/plain" data:data];
NSURL *fileURL = [self createTempFile];
[api uploadFileWithCompletionBlock:@1 additionalMetadata:@"special-metadata" file:file completionHandler:^(NSError *error) {
[api uploadFileWithCompletionBlock:@1 additionalMetadata:@"special-metadata" file:fileURL completionHandler:^(NSError *error) {
if(error) {
// good
XCTFail(@"expected a failure");
@ -269,4 +275,12 @@
pet.photoUrls = photos;
return pet;
}
- (NSURL *) createTempFile {
NSString *filePath = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@", [[NSProcessInfo processInfo] globallyUniqueString]]];
NSData *data = [@"test string" dataUsingEncoding:NSUTF8StringEncoding];
[data writeToFile:filePath atomically:YES];
return [NSURL fileURLWithPath:filePath];
}
@end

View File

@ -1,7 +1,7 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import "SWGApiClient.h"
#import "SWGConfiguration.h"
#import <SwaggerClient/SWGApiClient.h>
#import <SwaggerClient/SWGConfiguration.h>
@interface SWGApiClientTest : XCTestCase

View File

@ -1,6 +1,6 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import "SWGStoreApi.h"
#import <SwaggerClient/SWGStoreApi.h>
@interface StoreApiTest : XCTestCase

View File

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.reverb.${PRODUCT_NAME:rfc1034identifier}</string>
<string>org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>

View File

@ -0,0 +1,8 @@
// The contents of this file are implicitly included at the beginning of every test case source file.
#ifdef __OBJC__
//@import Specta;
//@import Expecta;
#endif

View File

@ -0,0 +1,52 @@
//
// SwaggerClientTests.m
// SwaggerClientTests
//
// Created by geekerzp on 06/26/2015.
// Copyright (c) 2015 geekerzp. All rights reserved.
//
// https://github.com/Specta/Specta
/**
* show cases for Specta
**
SpecBegin(InitialSpecs)
describe(@"these will fail", ^{
it(@"can do maths", ^{
expect(1).to.equal(2);
});
it(@"can read", ^{
expect(@"number").to.equal(@"string");
});
it(@"will wait for 10 seconds and fail", ^{
waitUntil(^(DoneCallback done) {
});
});
});
describe(@"these will pass", ^{
it(@"can do maths", ^{
expect(1).beLessThan(23);
});
it(@"can read", ^{
expect(@"team").toNot.contain(@"I");
});
it(@"will wait and succeed", ^{
waitUntil(^(DoneCallback done) {
done();
});
});
});
SpecEnd
*/

View File

@ -1,6 +1,6 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import "SWGUserApi.h"
#import <SwaggerClient/SWGUserApi.h>
@interface UserApiTest : XCTestCase

Some files were not shown because too many files have changed in this diff Show More