diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m index c0ca97c3480..36a2a6d700a 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m @@ -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]; @@ -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; @@ -195,9 +189,6 @@ -(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status completionHandler: (void (^)(NSArray* 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]; @@ -256,9 +247,6 @@ -(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags completionHandler: (void (^)(NSArray* 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]; @@ -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; @@ -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]; @@ -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; @@ -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; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m index 2a17173f83a..ebf27ab982a 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m @@ -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; @@ -129,9 +126,6 @@ -(NSURLSessionTask*) getInventoryWithCompletionHandler: (void (^)(NSDictionary* 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]; @@ -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; @@ -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]; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m index e1acf3af007..2a1c4ecda81 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m @@ -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]; @@ -118,9 +115,6 @@ -(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) 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]; @@ -176,9 +170,6 @@ -(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) 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]; @@ -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; @@ -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; @@ -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]; @@ -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]; @@ -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; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m index f757e139d0e..4b1d014d2bc 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m @@ -89,7 +89,7 @@ - (instancetype)initWithBaseURL:(NSURL *)url configuration:(id #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) { @@ -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; } @@ -135,7 +135,7 @@ - (NSURLSessionDataTask*) downloadTaskWithCompletionBlock: (NSURLRequest *)reque completionBlock(file, nil); }]; - + return task; } @@ -222,7 +222,7 @@ - (NSURLSessionTask*) requestWithPath: (NSString*) path [self postProcessRequest:request]; - + NSURLSessionTask *task = nil; if ([self.downloadTaskResponseTypes containsObject:responseType]) { @@ -241,9 +241,9 @@ - (NSURLSessionTask*) requestWithPath: (NSString*) path completionBlock(response, error); }]; } - + [task resume]; - + return task; } @@ -330,7 +330,7 @@ - (void) updateHeaderParams:(NSDictionary * *)headers queryParams:(NSDictionary NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys]; - + id config = self.configuration; for (NSString *auth in authSettings) { NSDictionary *authSetting = config.authSettings[auth];