forked from loafle/openapi-generator-original
7644 objc deprecated afnetworking datataskwithrequest (#7645)
* Replacing calls to dataTaskWithRequest:completionHandler: In objc ApiClient-body.mustache, replacing calls to AFNetworking's deprecated `dataTaskWithRequest:completionHandler:` with calls to `dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:`. * Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change: ./bin/objc-petstore.sh and ./bin/security/objc-petstore.sh
This commit is contained in:
parent
c599906f1a
commit
9fb2c29a46
@ -90,7 +90,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response)
|
||||
|
||||
- (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock {
|
||||
|
||||
NSURLSessionDataTask *task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
|
||||
NSURLSessionDataTask *task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
|
||||
{{classPrefix}}DebugLogResponse(response, responseObject,request,error);
|
||||
if(!error) {
|
||||
completionBlock(responseObject, nil);
|
||||
@ -112,7 +112,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response)
|
||||
|
||||
__block NSString * tempFolderPath = [self.configuration.tempFolderPath copy];
|
||||
|
||||
NSURLSessionDataTask* task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
|
||||
NSURLSessionDataTask* task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
|
||||
{{classPrefix}}DebugLogResponse(response, responseObject,request,error);
|
||||
|
||||
if(error) {
|
||||
|
@ -66,7 +66,7 @@ extern NSString *const SWGResponseObjectErrorKey;
|
||||
/**
|
||||
* Updates header parameters and query parameters for authentication
|
||||
*
|
||||
* @param headers The header parameter will be udpated, passed by pointer to pointer.
|
||||
* @param headers The header parameter will be updated, passed by pointer to pointer.
|
||||
* @param querys The query parameters will be updated, passed by pointer to pointer.
|
||||
* @param authSettings The authentication names NSArray.
|
||||
*/
|
||||
|
@ -90,7 +90,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) {
|
||||
|
||||
- (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock {
|
||||
|
||||
NSURLSessionDataTask *task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
|
||||
NSURLSessionDataTask *task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
|
||||
SWGDebugLogResponse(response, responseObject,request,error);
|
||||
if(!error) {
|
||||
completionBlock(responseObject, nil);
|
||||
@ -112,7 +112,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) {
|
||||
|
||||
__block NSString * tempFolderPath = [self.configuration.tempFolderPath copy];
|
||||
|
||||
NSURLSessionDataTask* task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
|
||||
NSURLSessionDataTask* task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
|
||||
SWGDebugLogResponse(response, responseObject,request,error);
|
||||
|
||||
if(error) {
|
||||
|
@ -36,7 +36,7 @@ git_remote=`git remote`
|
||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||
|
||||
if [ "$GIT_TOKEN" = "" ]; then
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||
|
@ -90,7 +90,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) {
|
||||
|
||||
- (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock {
|
||||
|
||||
NSURLSessionDataTask *task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
|
||||
NSURLSessionDataTask *task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
|
||||
SWGDebugLogResponse(response, responseObject,request,error);
|
||||
if(!error) {
|
||||
completionBlock(responseObject, nil);
|
||||
@ -112,7 +112,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) {
|
||||
|
||||
__block NSString * tempFolderPath = [self.configuration.tempFolderPath copy];
|
||||
|
||||
NSURLSessionDataTask* task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
|
||||
NSURLSessionDataTask* task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
|
||||
SWGDebugLogResponse(response, responseObject,request,error);
|
||||
|
||||
if(error) {
|
||||
|
@ -36,7 +36,7 @@ git_remote=`git remote`
|
||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||
|
||||
if [ "$GIT_TOKEN" = "" ]; then
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||
|
Loading…
x
Reference in New Issue
Block a user