diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache index 896871b8d7e..95733f9d546 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache @@ -132,15 +132,11 @@ private var urlSessionStore = SynchronizedDictionary() do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index c7804d16e30..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index c7804d16e30..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index c7804d16e30..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index a2de4751c64..8e6e4d85ec3 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -132,15 +132,11 @@ internal class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index c7804d16e30..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index c7804d16e30..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index c7804d16e30..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index c7804d16e30..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index c7804d16e30..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index c7804d16e30..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest()