Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ -(NSURLSessionTask*) addPetWithBody: (SWGPet*) body
completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
Expand Down Expand Up @@ -132,9 +129,6 @@ -(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId

NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
if (petId != nil) {
pathParams[@"petId"] = petId;
Expand Down Expand Up @@ -195,9 +189,6 @@ -(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray<NSString*>*) status
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
Expand Down Expand Up @@ -256,9 +247,6 @@ -(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray<NSString*>*) tags
completionHandler: (void (^)(NSArray<SWGPet>* output, NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
Expand Down Expand Up @@ -328,9 +316,6 @@ -(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId

NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
if (petId != nil) {
pathParams[@"petId"] = petId;
Expand Down Expand Up @@ -388,9 +373,6 @@ -(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body
completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
Expand Down Expand Up @@ -463,9 +445,6 @@ -(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId

NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
if (petId != nil) {
pathParams[@"petId"] = petId;
Expand Down Expand Up @@ -546,9 +525,6 @@ -(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId

NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}/uploadImage"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
if (petId != nil) {
pathParams[@"petId"] = petId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ -(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId

NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
if (orderId != nil) {
pathParams[@"orderId"] = orderId;
Expand Down Expand Up @@ -129,9 +126,6 @@ -(NSURLSessionTask*) getInventoryWithCompletionHandler:
(void (^)(NSDictionary<NSString*, NSNumber*>* output, NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
Expand Down Expand Up @@ -197,9 +191,6 @@ -(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId

NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
if (orderId != nil) {
pathParams[@"orderId"] = orderId;
Expand Down Expand Up @@ -257,9 +248,6 @@ -(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body
completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ -(NSURLSessionTask*) createUserWithBody: (SWGUser*) body
completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
Expand Down Expand Up @@ -118,9 +115,6 @@ -(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
Expand Down Expand Up @@ -176,9 +170,6 @@ -(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray<SWGUser>*) body
completionHandler: (void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
Expand Down Expand Up @@ -245,9 +236,6 @@ -(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username

NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
if (username != nil) {
pathParams[@"username"] = username;
Expand Down Expand Up @@ -316,9 +304,6 @@ -(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username

NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
if (username != nil) {
pathParams[@"username"] = username;
Expand Down Expand Up @@ -379,9 +364,6 @@ -(NSURLSessionTask*) loginUserWithUsername: (NSString*) username
completionHandler: (void (^)(NSString* output, NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/login"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
Expand Down Expand Up @@ -440,9 +422,6 @@ -(NSURLSessionTask*) logoutUserWithCompletionHandler:
(void (^)(NSError* error)) handler {
NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
Expand Down Expand Up @@ -511,9 +490,6 @@ -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username

NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
if (username != nil) {
pathParams[@"username"] = username;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ - (instancetype)initWithBaseURL:(NSURL *)url configuration:(id<SWGConfiguration>
#pragma mark - Task Methods

- (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock {

NSURLSessionDataTask *task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
SWGDebugLogResponse(response, responseObject,request,error);
if(!error) {
Expand All @@ -104,7 +104,7 @@ - (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request compl
NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo];
completionBlock(nil, augmentedError);
}];

return task;
}

Expand Down Expand Up @@ -135,7 +135,7 @@ - (NSURLSessionDataTask*) downloadTaskWithCompletionBlock: (NSURLRequest *)reque

completionBlock(file, nil);
}];

return task;
}

Expand Down Expand Up @@ -222,7 +222,7 @@ - (NSURLSessionTask*) requestWithPath: (NSString*) path

[self postProcessRequest:request];


NSURLSessionTask *task = nil;

if ([self.downloadTaskResponseTypes containsObject:responseType]) {
Expand All @@ -241,9 +241,9 @@ - (NSURLSessionTask*) requestWithPath: (NSString*) path
completionBlock(response, error);
}];
}

[task resume];

return task;
}

Expand Down Expand Up @@ -330,7 +330,7 @@ - (void) updateHeaderParams:(NSDictionary * *)headers queryParams:(NSDictionary

NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers];
NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys];

id<SWGConfiguration> config = self.configuration;
for (NSString *auth in authSettings) {
NSDictionary *authSetting = config.authSettings[auth];
Expand Down