From 5dc0b70081d10dcc28dbc885636e1ddc71cf386f Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Sun, 5 Mar 2023 11:35:51 +0000 Subject: [PATCH] [swift5][client] remove deprecated APIs (#14635) * [swift5][client] remove deprecated APIs * [swift5][client] remove deprecated APIs --- bin/configs/swift5-resultLibrary.yaml | 1 - docs/generators/swift5.md | 1 - .../languages/Swift5ClientCodegen.java | 14 --------- .../src/main/resources/swift5/APIs.mustache | 14 ++------- .../resources/swift5/Configuration.mustache | 4 --- .../URLSessionImplementations.mustache | 29 ++++--------------- .../options/Swift5OptionsProvider.java | 2 -- .../codegen/swift5/Swift5OptionsTest.java | 1 - .../Classes/OpenAPIs/APIs.swift | 8 ----- .../Classes/OpenAPIs/Configuration.swift | 4 --- .../Classes/OpenAPIs/APIs.swift | 10 ------- .../Classes/OpenAPIs/Configuration.swift | 4 --- .../OpenAPIs/URLSessionImplementations.swift | 29 ++++--------------- .../Classes/OpenAPIs/APIs.swift | 10 ------- .../Classes/OpenAPIs/Configuration.swift | 4 --- .../OpenAPIs/URLSessionImplementations.swift | 29 ++++--------------- .../Classes/OpenAPIs/APIs.swift | 10 ------- .../Classes/OpenAPIs/Configuration.swift | 4 --- .../OpenAPIs/URLSessionImplementations.swift | 29 ++++--------------- .../Classes/OpenAPIs/APIs.swift | 10 ------- .../Classes/OpenAPIs/Configuration.swift | 4 --- .../OpenAPIs/URLSessionImplementations.swift | 29 ++++--------------- .../Classes/OpenAPIs/APIs.swift | 10 ------- .../Classes/OpenAPIs/Configuration.swift | 4 --- .../OpenAPIs/URLSessionImplementations.swift | 29 ++++--------------- .../Classes/OpenAPIs/APIs.swift | 10 ------- .../Classes/OpenAPIs/Configuration.swift | 4 --- .../OpenAPIs/URLSessionImplementations.swift | 29 ++++--------------- .../Classes/OpenAPIs/APIs.swift | 10 ------- .../Classes/OpenAPIs/Configuration.swift | 4 --- .../OpenAPIs/URLSessionImplementations.swift | 29 ++++--------------- .../Classes/OpenAPIs/APIs.swift | 10 ------- .../Classes/OpenAPIs/Configuration.swift | 4 --- .../OpenAPIs/URLSessionImplementations.swift | 29 ++++--------------- .../Classes/OpenAPIs/APIs.swift | 10 ------- .../Classes/OpenAPIs/Configuration.swift | 4 --- .../OpenAPIs/URLSessionImplementations.swift | 29 ++++--------------- .../Classes/OpenAPIs/APIs.swift | 10 ------- .../Classes/OpenAPIs/Configuration.swift | 4 --- .../OpenAPIs/URLSessionImplementations.swift | 29 ++++--------------- .../Classes/OpenAPIs/APIs.swift | 2 -- .../Classes/OpenAPIs/Configuration.swift | 4 --- .../OpenAPIs/URLSessionImplementations.swift | 29 ++++--------------- .../Classes/OpenAPIs/APIs.swift | 10 ------- .../Classes/OpenAPIs/Configuration.swift | 4 --- .../OpenAPIs/URLSessionImplementations.swift | 29 ++++--------------- .../Sources/PetstoreClient/APIs.swift | 10 ------- .../PetstoreClient/Configuration.swift | 4 --- .../URLSessionImplementations.swift | 29 ++++--------------- .../Sources/PetstoreClient/APIs.swift | 8 ----- .../Classes/OpenAPIs/APIs.swift | 10 ------- .../Classes/OpenAPIs/Configuration.swift | 4 --- .../OpenAPIs/URLSessionImplementations.swift | 29 ++++--------------- 53 files changed, 77 insertions(+), 603 deletions(-) diff --git a/bin/configs/swift5-resultLibrary.yaml b/bin/configs/swift5-resultLibrary.yaml index 01de8b1d98ee..0f0e4373e2c5 100644 --- a/bin/configs/swift5-resultLibrary.yaml +++ b/bin/configs/swift5-resultLibrary.yaml @@ -9,4 +9,3 @@ additionalProperties: podSummary: PetstoreClient projectName: PetstoreClient podHomepage: https://github.com/openapitools/openapi-generator - removeMigrationProjectNameClass: true diff --git a/docs/generators/swift5.md b/docs/generators/swift5.md index 72887e3b55f2..baabd043a860 100644 --- a/docs/generators/swift5.md +++ b/docs/generators/swift5.md @@ -45,7 +45,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectName|Project name in Xcode| |null| |readonlyProperties|Make properties readonly (default: false)| |null| -|removeMigrationProjectNameClass|Make properties removeMigrationProjectNameClass (default: false)| |null| |responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift, Result, Combine, AsyncAwait are available.| |null| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java index 5bd1dfb2db04..d2e050e3162b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java @@ -61,7 +61,6 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig public static final String POD_SCREENSHOTS = "podScreenshots"; public static final String POD_DOCUMENTATION_URL = "podDocumentationURL"; public static final String READONLY_PROPERTIES = "readonlyProperties"; - public static final String REMOVE_MIGRATION_PROJECT_NAME_CLASS = "removeMigrationProjectNameClass"; public static final String SWIFT_USE_API_NAMESPACE = "swiftUseApiNamespace"; public static final String DEFAULT_POD_AUTHORS = "OpenAPI Generator"; public static final String LENIENT_TYPE_CAST = "lenientTypeCast"; @@ -89,7 +88,6 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig protected boolean objcCompatible = false; protected boolean lenientTypeCast = false; protected boolean readonlyProperties = false; - protected boolean removeMigrationProjectNameClass = false; protected boolean swiftUseApiNamespace = false; protected boolean useSPMFileStructure = false; protected String swiftPackagePath = "Classes" + File.separator + "OpenAPIs"; @@ -275,8 +273,6 @@ public Swift5ClientCodegen() { "Documentation URL used for Podspec")); cliOptions.add(new CliOption(READONLY_PROPERTIES, "Make properties " + "readonly (default: false)")); - cliOptions.add(new CliOption(REMOVE_MIGRATION_PROJECT_NAME_CLASS, "Make properties " - + "removeMigrationProjectNameClass (default: false)")); cliOptions.add(new CliOption(SWIFT_USE_API_NAMESPACE, "Flag to make all the API classes inner-class " + "of {{projectName}}API")); @@ -476,12 +472,6 @@ public void processOpts() { } additionalProperties.put(READONLY_PROPERTIES, readonlyProperties); - // Setup removeMigrationProjectNameClass option, which keeps or remove the projectName class - if (additionalProperties.containsKey(REMOVE_MIGRATION_PROJECT_NAME_CLASS)) { - setRemoveMigrationProjectNameClass(convertPropertyToBooleanAndWriteBack(REMOVE_MIGRATION_PROJECT_NAME_CLASS)); - } - additionalProperties.put(REMOVE_MIGRATION_PROJECT_NAME_CLASS, removeMigrationProjectNameClass); - // Setup swiftUseApiNamespace option, which makes all the API // classes inner-class of {{projectName}}API if (additionalProperties.containsKey(SWIFT_USE_API_NAMESPACE)) { @@ -973,10 +963,6 @@ public void setReadonlyProperties(boolean readonlyProperties) { this.readonlyProperties = readonlyProperties; } - public void setRemoveMigrationProjectNameClass(boolean removeMigrationProjectNameClass) { - this.removeMigrationProjectNameClass = removeMigrationProjectNameClass; - } - public void setResponseAs(String[] responseAs) { this.responseAs = responseAs; } diff --git a/modules/openapi-generator/src/main/resources/swift5/APIs.mustache b/modules/openapi-generator/src/main/resources/swift5/APIs.mustache index 65fccdf1df09..a2452ecc648f 100644 --- a/modules/openapi-generator/src/main/resources/swift5/APIs.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/APIs.mustache @@ -6,15 +6,7 @@ import Foundation{{#useVapor}} import Vapor -{{/useVapor}}{{^removeMigrationProjectNameClass}} - -// We reverted the change of {{projectName}}API to {{projectName}} introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 -// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 -// If you are affected by this issue, please consider removing the following two lines, -// By setting the option removeMigrationProjectNameClass to true in the generator -@available(*, deprecated, renamed: "{{projectName}}API") -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} typealias {{projectName}} = {{projectName}}API -{{/removeMigrationProjectNameClass}} +{{/useVapor}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class {{projectName}}API { {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var basePath = "{{{basePath}}}" @@ -39,9 +31,7 @@ import Vapor {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let requestTask: RequestTask = RequestTask() {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let requiresAuthentication: Bool - /// Optional block to obtain a reference to the request's progress instance when available.{{#useURLSession}} - /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. - /// If you need to get the request's progress in older OS versions, please use Alamofire http client.{{/useURLSession}} + /// Optional block to obtain a reference to the request's progress instance when available. {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var onProgressReady: ((Progress) -> Void)? required {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { diff --git a/modules/openapi-generator/src/main/resources/swift5/Configuration.mustache b/modules/openapi-generator/src/main/resources/swift5/Configuration.mustache index 0f3013e792ea..9cf0a88b29bb 100644 --- a/modules/openapi-generator/src/main/resources/swift5/Configuration.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/Configuration.mustache @@ -18,10 +18,6 @@ extension {{projectName}}API { {{#useVapor}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var apiClient: Vapor.Client? = nil {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var apiWrapper: (inout Vapor.ClientRequest) throws -> () = { _ in } {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var contentConfiguration = ContentConfiguration.default(){{/useVapor}}{{^useVapor}} - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" /// Configures the range of HTTP status codes that will result in a successful response /// /// If a HTTP status code is outside of this range the response will be interpreted as failed. 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 a369e6f0eea5..73f24a03e07d 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 @@ -52,7 +52,7 @@ private var credentialStore = SynchronizedDictionary() - intercept and handle errors like authorization - retry the request. */ - @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + @available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? required {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { @@ -141,32 +141,13 @@ private var credentialStore = SynchronizedDictionary() } let dataTask = urlSession.dataTask(with: request) { data, response, error in - - if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - - taskCompletionShouldRetry(data, response, error) { shouldRetry in - - if shouldRetry { - cleanupRequest() - self.execute(apiResponseQueue, completion) - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } - } - } - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() } } - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - onProgressReady?(dataTask.progress) - } + onProgressReady?(dataTask.progress) taskIdentifier = dataTask.taskIdentifier challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java index 78f9e3487e7e..33e4d608b65f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java @@ -45,7 +45,6 @@ public class Swift5OptionsProvider implements OptionsProvider { public static final String POD_SCREENSHOTS_VALUE = "podScreenshots"; public static final String POD_DOCUMENTATION_URL_VALUE = "podDocumentationURL"; public static final String READONLY_PROPERTIES_VALUE = "false"; - public static final String REMOVE_MIGRATION_PROJECT_NAME_CLASS_VALUE = "false"; public static final String SWIFT_USE_API_NAMESPACE_VALUE = "swiftUseApiNamespace"; public static final String USE_BACKTICKS_ESCAPES_VALUE = "false"; public static final String GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE = "true"; @@ -85,7 +84,6 @@ public Map createOptions() { .put(Swift5ClientCodegen.POD_SCREENSHOTS, POD_SCREENSHOTS_VALUE) .put(Swift5ClientCodegen.POD_DOCUMENTATION_URL, POD_DOCUMENTATION_URL_VALUE) .put(Swift5ClientCodegen.READONLY_PROPERTIES, READONLY_PROPERTIES_VALUE) - .put(Swift5ClientCodegen.REMOVE_MIGRATION_PROJECT_NAME_CLASS, REMOVE_MIGRATION_PROJECT_NAME_CLASS_VALUE) .put(Swift5ClientCodegen.SWIFT_USE_API_NAMESPACE, SWIFT_USE_API_NAMESPACE_VALUE) .put(Swift5ClientCodegen.USE_BACKTICK_ESCAPES, USE_BACKTICKS_ESCAPES_VALUE) .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java index 20f6c3f46a66..8eba7d9c3e35 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java @@ -48,7 +48,6 @@ protected void verifyOptions() { verify(clientCodegen).setLenientTypeCast(Boolean.parseBoolean(Swift5OptionsProvider.LENIENT_TYPE_CAST_VALUE)); verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(Swift5OptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); verify(clientCodegen).setReadonlyProperties(Boolean.parseBoolean(Swift5OptionsProvider.READONLY_PROPERTIES_VALUE)); - verify(clientCodegen).setRemoveMigrationProjectNameClass(Boolean.parseBoolean(Swift5OptionsProvider.REMOVE_MIGRATION_PROJECT_NAME_CLASS_VALUE)); verify(clientCodegen).setGenerateModelAdditionalProperties(Boolean.parseBoolean(Swift5OptionsProvider.GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE)); verify(clientCodegen).setHashableModels(Boolean.parseBoolean(Swift5OptionsProvider.HASHABLE_MODELS_VALUE)); verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(Swift5OptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 7bb346ea9ac4..156474f83389 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -5,14 +5,6 @@ // import Foundation - -// We reverted the change of PetstoreClientAPI to PetstoreClient introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 -// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 -// If you are affected by this issue, please consider removing the following two lines, -// By setting the option removeMigrationProjectNameClass to true in the generator -@available(*, deprecated, renamed: "PetstoreClientAPI") -public typealias PetstoreClient = PetstoreClientAPI - open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var customHeaders: [String: String] = [:] diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index def40552f742..ce145c1cc7a6 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -9,10 +9,6 @@ import Alamofire open class Configuration { - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" /// Configures the range of HTTP status codes that will result in a successful response /// /// If a HTTP status code is outside of this range the response will be interpreted as failed. diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index fab92b3a08cb..24357d9e8c44 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -5,14 +5,6 @@ // import Foundation - -// We reverted the change of PetstoreClientAPI to PetstoreClient introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 -// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 -// If you are affected by this issue, please consider removing the following two lines, -// By setting the option removeMigrationProjectNameClass to true in the generator -@available(*, deprecated, renamed: "PetstoreClientAPI") -public typealias PetstoreClient = PetstoreClientAPI - open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var customHeaders: [String: String] = [:] @@ -31,8 +23,6 @@ open class RequestBuilder { public let requiresAuthentication: Bool /// Optional block to obtain a reference to the request's progress instance when available. - /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. - /// If you need to get the request's progress in older OS versions, please use Alamofire http client. public var onProgressReady: ((Progress) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 03789f4b4925..df53ee090108 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -8,10 +8,6 @@ import Foundation open class Configuration { - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" /// Configures the range of HTTP status codes that will result in a successful response /// /// If a HTTP status code is outside of this range the response will be interpreted as failed. diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index da9dca29ac46..f04c90878cbb 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -52,7 +52,7 @@ open class URLSessionRequestBuilder: RequestBuilder { - intercept and handle errors like authorization - retry the request. */ - @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + @available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { @@ -141,32 +141,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } let dataTask = urlSession.dataTask(with: request) { data, response, error in - - if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - - taskCompletionShouldRetry(data, response, error) { shouldRetry in - - if shouldRetry { - cleanupRequest() - self.execute(apiResponseQueue, completion) - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } - } - } - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() } } - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - onProgressReady?(dataTask.progress) - } + onProgressReady?(dataTask.progress) taskIdentifier = dataTask.taskIdentifier challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 8f74ebeeb74f..5f4f3c790ab8 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -5,14 +5,6 @@ // import Foundation - -// We reverted the change of PetstoreClientAPI to PetstoreClient introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 -// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 -// If you are affected by this issue, please consider removing the following two lines, -// By setting the option removeMigrationProjectNameClass to true in the generator -@available(*, deprecated, renamed: "PetstoreClientAPI") -public typealias PetstoreClient = PetstoreClientAPI - open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var customHeaders: [String: String] = [:] @@ -31,8 +23,6 @@ open class RequestBuilder { public let requiresAuthentication: Bool /// Optional block to obtain a reference to the request's progress instance when available. - /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. - /// If you need to get the request's progress in older OS versions, please use Alamofire http client. public var onProgressReady: ((Progress) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 03789f4b4925..df53ee090108 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -8,10 +8,6 @@ import Foundation open class Configuration { - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" /// Configures the range of HTTP status codes that will result in a successful response /// /// If a HTTP status code is outside of this range the response will be interpreted as failed. 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 da9dca29ac46..f04c90878cbb 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -52,7 +52,7 @@ open class URLSessionRequestBuilder: RequestBuilder { - intercept and handle errors like authorization - retry the request. */ - @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + @available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { @@ -141,32 +141,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } let dataTask = urlSession.dataTask(with: request) { data, response, error in - - if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - - taskCompletionShouldRetry(data, response, error) { shouldRetry in - - if shouldRetry { - cleanupRequest() - self.execute(apiResponseQueue, completion) - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } - } - } - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() } } - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - onProgressReady?(dataTask.progress) - } + onProgressReady?(dataTask.progress) taskIdentifier = dataTask.taskIdentifier challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift index 8f74ebeeb74f..5f4f3c790ab8 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -5,14 +5,6 @@ // import Foundation - -// We reverted the change of PetstoreClientAPI to PetstoreClient introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 -// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 -// If you are affected by this issue, please consider removing the following two lines, -// By setting the option removeMigrationProjectNameClass to true in the generator -@available(*, deprecated, renamed: "PetstoreClientAPI") -public typealias PetstoreClient = PetstoreClientAPI - open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var customHeaders: [String: String] = [:] @@ -31,8 +23,6 @@ open class RequestBuilder { public let requiresAuthentication: Bool /// Optional block to obtain a reference to the request's progress instance when available. - /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. - /// If you need to get the request's progress in older OS versions, please use Alamofire http client. public var onProgressReady: ((Progress) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 03789f4b4925..df53ee090108 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -8,10 +8,6 @@ import Foundation open class Configuration { - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" /// Configures the range of HTTP status codes that will result in a successful response /// /// If a HTTP status code is outside of this range the response will be interpreted as failed. 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 da9dca29ac46..f04c90878cbb 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -52,7 +52,7 @@ open class URLSessionRequestBuilder: RequestBuilder { - intercept and handle errors like authorization - retry the request. */ - @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + @available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { @@ -141,32 +141,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } let dataTask = urlSession.dataTask(with: request) { data, response, error in - - if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - - taskCompletionShouldRetry(data, response, error) { shouldRetry in - - if shouldRetry { - cleanupRequest() - self.execute(apiResponseQueue, completion) - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } - } - } - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() } } - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - onProgressReady?(dataTask.progress) - } + onProgressReady?(dataTask.progress) taskIdentifier = dataTask.taskIdentifier challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift index b0fe3685df0c..fec54e5fd17f 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -5,14 +5,6 @@ // import Foundation - -// We reverted the change of PetstoreClientAPI to PetstoreClient introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 -// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 -// If you are affected by this issue, please consider removing the following two lines, -// By setting the option removeMigrationProjectNameClass to true in the generator -@available(*, deprecated, renamed: "PetstoreClientAPI") -public typealias PetstoreClient = PetstoreClientAPI - open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io/v2" public static var customHeaders: [String: String] = [:] @@ -31,8 +23,6 @@ open class RequestBuilder { public let requiresAuthentication: Bool /// Optional block to obtain a reference to the request's progress instance when available. - /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. - /// If you need to get the request's progress in older OS versions, please use Alamofire http client. public var onProgressReady: ((Progress) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 03789f4b4925..df53ee090108 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -8,10 +8,6 @@ import Foundation open class Configuration { - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" /// Configures the range of HTTP status codes that will result in a successful response /// /// If a HTTP status code is outside of this range the response will be interpreted as failed. 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 da9dca29ac46..f04c90878cbb 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -52,7 +52,7 @@ open class URLSessionRequestBuilder: RequestBuilder { - intercept and handle errors like authorization - retry the request. */ - @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + @available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { @@ -141,32 +141,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } let dataTask = urlSession.dataTask(with: request) { data, response, error in - - if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - - taskCompletionShouldRetry(data, response, error) { shouldRetry in - - if shouldRetry { - cleanupRequest() - self.execute(apiResponseQueue, completion) - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } - } - } - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() } } - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - onProgressReady?(dataTask.progress) - } + onProgressReady?(dataTask.progress) taskIdentifier = dataTask.taskIdentifier challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs.swift index 8f74ebeeb74f..5f4f3c790ab8 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -5,14 +5,6 @@ // import Foundation - -// We reverted the change of PetstoreClientAPI to PetstoreClient introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 -// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 -// If you are affected by this issue, please consider removing the following two lines, -// By setting the option removeMigrationProjectNameClass to true in the generator -@available(*, deprecated, renamed: "PetstoreClientAPI") -public typealias PetstoreClient = PetstoreClientAPI - open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var customHeaders: [String: String] = [:] @@ -31,8 +23,6 @@ open class RequestBuilder { public let requiresAuthentication: Bool /// Optional block to obtain a reference to the request's progress instance when available. - /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. - /// If you need to get the request's progress in older OS versions, please use Alamofire http client. public var onProgressReady: ((Progress) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 03789f4b4925..df53ee090108 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -8,10 +8,6 @@ import Foundation open class Configuration { - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" /// Configures the range of HTTP status codes that will result in a successful response /// /// If a HTTP status code is outside of this range the response will be interpreted as failed. diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index da9dca29ac46..f04c90878cbb 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -52,7 +52,7 @@ open class URLSessionRequestBuilder: RequestBuilder { - intercept and handle errors like authorization - retry the request. */ - @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + @available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { @@ -141,32 +141,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } let dataTask = urlSession.dataTask(with: request) { data, response, error in - - if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - - taskCompletionShouldRetry(data, response, error) { shouldRetry in - - if shouldRetry { - cleanupRequest() - self.execute(apiResponseQueue, completion) - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } - } - } - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() } } - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - onProgressReady?(dataTask.progress) - } + onProgressReady?(dataTask.progress) taskIdentifier = dataTask.taskIdentifier challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift index 353a183b4342..e5c24833f23f 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -5,14 +5,6 @@ // import Foundation - -// We reverted the change of PetstoreClientAPI to PetstoreClient introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 -// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 -// If you are affected by this issue, please consider removing the following two lines, -// By setting the option removeMigrationProjectNameClass to true in the generator -@available(*, deprecated, renamed: "PetstoreClientAPI") -internal typealias PetstoreClient = PetstoreClientAPI - internal class PetstoreClientAPI { internal static var basePath = "http://petstore.swagger.io:80/v2" internal static var customHeaders: [String: String] = [:] @@ -31,8 +23,6 @@ internal class RequestBuilder { internal let requiresAuthentication: Bool /// Optional block to obtain a reference to the request's progress instance when available. - /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. - /// If you need to get the request's progress in older OS versions, please use Alamofire http client. internal var onProgressReady: ((Progress) -> Void)? required internal init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 84d878ff6c2f..177ae20897da 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -8,10 +8,6 @@ import Foundation internal class Configuration { - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - internal static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" /// Configures the range of HTTP status codes that will result in a successful response /// /// If a HTTP status code is outside of this range the response will be interpreted as failed. 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 86926821e793..47c9e9435e1f 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -52,7 +52,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { - intercept and handle errors like authorization - retry the request. */ - @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + @available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") internal var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? required internal init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { @@ -141,32 +141,13 @@ internal class URLSessionRequestBuilder: RequestBuilder { } let dataTask = urlSession.dataTask(with: request) { data, response, error in - - if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - - taskCompletionShouldRetry(data, response, error) { shouldRetry in - - if shouldRetry { - cleanupRequest() - self.execute(apiResponseQueue, completion) - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } - } - } - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() } } - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - onProgressReady?(dataTask.progress) - } + onProgressReady?(dataTask.progress) taskIdentifier = dataTask.taskIdentifier challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift index 8f74ebeeb74f..5f4f3c790ab8 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -5,14 +5,6 @@ // import Foundation - -// We reverted the change of PetstoreClientAPI to PetstoreClient introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 -// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 -// If you are affected by this issue, please consider removing the following two lines, -// By setting the option removeMigrationProjectNameClass to true in the generator -@available(*, deprecated, renamed: "PetstoreClientAPI") -public typealias PetstoreClient = PetstoreClientAPI - open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var customHeaders: [String: String] = [:] @@ -31,8 +23,6 @@ open class RequestBuilder { public let requiresAuthentication: Bool /// Optional block to obtain a reference to the request's progress instance when available. - /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. - /// If you need to get the request's progress in older OS versions, please use Alamofire http client. public var onProgressReady: ((Progress) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 03789f4b4925..df53ee090108 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -8,10 +8,6 @@ import Foundation open class Configuration { - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" /// Configures the range of HTTP status codes that will result in a successful response /// /// If a HTTP status code is outside of this range the response will be interpreted as failed. 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 da9dca29ac46..f04c90878cbb 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -52,7 +52,7 @@ open class URLSessionRequestBuilder: RequestBuilder { - intercept and handle errors like authorization - retry the request. */ - @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + @available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { @@ -141,32 +141,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } let dataTask = urlSession.dataTask(with: request) { data, response, error in - - if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - - taskCompletionShouldRetry(data, response, error) { shouldRetry in - - if shouldRetry { - cleanupRequest() - self.execute(apiResponseQueue, completion) - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } - } - } - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() } } - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - onProgressReady?(dataTask.progress) - } + onProgressReady?(dataTask.progress) taskIdentifier = dataTask.taskIdentifier challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs.swift index 513c1222ada3..30b466c25a1e 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -5,14 +5,6 @@ // import Foundation - -// We reverted the change of PetstoreClientAPI to PetstoreClient introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 -// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 -// If you are affected by this issue, please consider removing the following two lines, -// By setting the option removeMigrationProjectNameClass to true in the generator -@available(*, deprecated, renamed: "PetstoreClientAPI") -public typealias PetstoreClient = PetstoreClientAPI - open class PetstoreClientAPI { public static var basePath = "http://localhost" public static var customHeaders: [String: String] = [:] @@ -31,8 +23,6 @@ open class RequestBuilder { public let requiresAuthentication: Bool /// Optional block to obtain a reference to the request's progress instance when available. - /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. - /// If you need to get the request's progress in older OS versions, please use Alamofire http client. public var onProgressReady: ((Progress) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 03789f4b4925..df53ee090108 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -8,10 +8,6 @@ import Foundation open class Configuration { - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" /// Configures the range of HTTP status codes that will result in a successful response /// /// If a HTTP status code is outside of this range the response will be interpreted as failed. diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index da9dca29ac46..f04c90878cbb 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -52,7 +52,7 @@ open class URLSessionRequestBuilder: RequestBuilder { - intercept and handle errors like authorization - retry the request. */ - @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + @available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { @@ -141,32 +141,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } let dataTask = urlSession.dataTask(with: request) { data, response, error in - - if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - - taskCompletionShouldRetry(data, response, error) { shouldRetry in - - if shouldRetry { - cleanupRequest() - self.execute(apiResponseQueue, completion) - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } - } - } - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() } } - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - onProgressReady?(dataTask.progress) - } + onProgressReady?(dataTask.progress) taskIdentifier = dataTask.taskIdentifier challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 8f74ebeeb74f..5f4f3c790ab8 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -5,14 +5,6 @@ // import Foundation - -// We reverted the change of PetstoreClientAPI to PetstoreClient introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 -// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 -// If you are affected by this issue, please consider removing the following two lines, -// By setting the option removeMigrationProjectNameClass to true in the generator -@available(*, deprecated, renamed: "PetstoreClientAPI") -public typealias PetstoreClient = PetstoreClientAPI - open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var customHeaders: [String: String] = [:] @@ -31,8 +23,6 @@ open class RequestBuilder { public let requiresAuthentication: Bool /// Optional block to obtain a reference to the request's progress instance when available. - /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. - /// If you need to get the request's progress in older OS versions, please use Alamofire http client. public var onProgressReady: ((Progress) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 03789f4b4925..df53ee090108 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -8,10 +8,6 @@ import Foundation open class Configuration { - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" /// Configures the range of HTTP status codes that will result in a successful response /// /// If a HTTP status code is outside of this range the response will be interpreted as failed. 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 da9dca29ac46..f04c90878cbb 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -52,7 +52,7 @@ open class URLSessionRequestBuilder: RequestBuilder { - intercept and handle errors like authorization - retry the request. */ - @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + @available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { @@ -141,32 +141,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } let dataTask = urlSession.dataTask(with: request) { data, response, error in - - if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - - taskCompletionShouldRetry(data, response, error) { shouldRetry in - - if shouldRetry { - cleanupRequest() - self.execute(apiResponseQueue, completion) - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } - } - } - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() } } - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - onProgressReady?(dataTask.progress) - } + onProgressReady?(dataTask.progress) taskIdentifier = dataTask.taskIdentifier challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift index 8f74ebeeb74f..5f4f3c790ab8 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -5,14 +5,6 @@ // import Foundation - -// We reverted the change of PetstoreClientAPI to PetstoreClient introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 -// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 -// If you are affected by this issue, please consider removing the following two lines, -// By setting the option removeMigrationProjectNameClass to true in the generator -@available(*, deprecated, renamed: "PetstoreClientAPI") -public typealias PetstoreClient = PetstoreClientAPI - open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var customHeaders: [String: String] = [:] @@ -31,8 +23,6 @@ open class RequestBuilder { public let requiresAuthentication: Bool /// Optional block to obtain a reference to the request's progress instance when available. - /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. - /// If you need to get the request's progress in older OS versions, please use Alamofire http client. public var onProgressReady: ((Progress) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 03789f4b4925..df53ee090108 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -8,10 +8,6 @@ import Foundation open class Configuration { - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" /// Configures the range of HTTP status codes that will result in a successful response /// /// If a HTTP status code is outside of this range the response will be interpreted as failed. 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 da9dca29ac46..f04c90878cbb 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -52,7 +52,7 @@ open class URLSessionRequestBuilder: RequestBuilder { - intercept and handle errors like authorization - retry the request. */ - @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + @available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { @@ -141,32 +141,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } let dataTask = urlSession.dataTask(with: request) { data, response, error in - - if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - - taskCompletionShouldRetry(data, response, error) { shouldRetry in - - if shouldRetry { - cleanupRequest() - self.execute(apiResponseQueue, completion) - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } - } - } - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() } } - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - onProgressReady?(dataTask.progress) - } + onProgressReady?(dataTask.progress) taskIdentifier = dataTask.taskIdentifier challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index e7026326eef1..5f4f3c790ab8 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -23,8 +23,6 @@ open class RequestBuilder { public let requiresAuthentication: Bool /// Optional block to obtain a reference to the request's progress instance when available. - /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. - /// If you need to get the request's progress in older OS versions, please use Alamofire http client. public var onProgressReady: ((Progress) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 03789f4b4925..df53ee090108 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -8,10 +8,6 @@ import Foundation open class Configuration { - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" /// Configures the range of HTTP status codes that will result in a successful response /// /// If a HTTP status code is outside of this range the response will be interpreted as failed. 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 da9dca29ac46..f04c90878cbb 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -52,7 +52,7 @@ open class URLSessionRequestBuilder: RequestBuilder { - intercept and handle errors like authorization - retry the request. */ - @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + @available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { @@ -141,32 +141,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } let dataTask = urlSession.dataTask(with: request) { data, response, error in - - if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - - taskCompletionShouldRetry(data, response, error) { shouldRetry in - - if shouldRetry { - cleanupRequest() - self.execute(apiResponseQueue, completion) - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } - } - } - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() } } - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - onProgressReady?(dataTask.progress) - } + onProgressReady?(dataTask.progress) taskIdentifier = dataTask.taskIdentifier challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 8f74ebeeb74f..5f4f3c790ab8 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -5,14 +5,6 @@ // import Foundation - -// We reverted the change of PetstoreClientAPI to PetstoreClient introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 -// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 -// If you are affected by this issue, please consider removing the following two lines, -// By setting the option removeMigrationProjectNameClass to true in the generator -@available(*, deprecated, renamed: "PetstoreClientAPI") -public typealias PetstoreClient = PetstoreClientAPI - open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var customHeaders: [String: String] = [:] @@ -31,8 +23,6 @@ open class RequestBuilder { public let requiresAuthentication: Bool /// Optional block to obtain a reference to the request's progress instance when available. - /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. - /// If you need to get the request's progress in older OS versions, please use Alamofire http client. public var onProgressReady: ((Progress) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 03789f4b4925..df53ee090108 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -8,10 +8,6 @@ import Foundation open class Configuration { - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" /// Configures the range of HTTP status codes that will result in a successful response /// /// If a HTTP status code is outside of this range the response will be interpreted as failed. 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 da9dca29ac46..f04c90878cbb 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -52,7 +52,7 @@ open class URLSessionRequestBuilder: RequestBuilder { - intercept and handle errors like authorization - retry the request. */ - @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + @available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { @@ -141,32 +141,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } let dataTask = urlSession.dataTask(with: request) { data, response, error in - - if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - - taskCompletionShouldRetry(data, response, error) { shouldRetry in - - if shouldRetry { - cleanupRequest() - self.execute(apiResponseQueue, completion) - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } - } - } - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() } } - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - onProgressReady?(dataTask.progress) - } + onProgressReady?(dataTask.progress) taskIdentifier = dataTask.taskIdentifier challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs.swift index 8f74ebeeb74f..5f4f3c790ab8 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs.swift @@ -5,14 +5,6 @@ // import Foundation - -// We reverted the change of PetstoreClientAPI to PetstoreClient introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 -// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 -// If you are affected by this issue, please consider removing the following two lines, -// By setting the option removeMigrationProjectNameClass to true in the generator -@available(*, deprecated, renamed: "PetstoreClientAPI") -public typealias PetstoreClient = PetstoreClientAPI - open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var customHeaders: [String: String] = [:] @@ -31,8 +23,6 @@ open class RequestBuilder { public let requiresAuthentication: Bool /// Optional block to obtain a reference to the request's progress instance when available. - /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. - /// If you need to get the request's progress in older OS versions, please use Alamofire http client. public var onProgressReady: ((Progress) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Configuration.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Configuration.swift index 399495722c6e..6763bc37a1c8 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Configuration.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Configuration.swift @@ -12,10 +12,6 @@ public typealias Configuration = PetstoreClientAPI.Configuration extension PetstoreClientAPI { open class Configuration { - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" /// Configures the range of HTTP status codes that will result in a successful response /// /// If a HTTP status code is outside of this range the response will be interpreted as failed. diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift index da9dca29ac46..f04c90878cbb 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift @@ -52,7 +52,7 @@ open class URLSessionRequestBuilder: RequestBuilder { - intercept and handle errors like authorization - retry the request. */ - @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + @available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { @@ -141,32 +141,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } let dataTask = urlSession.dataTask(with: request) { data, response, error in - - if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - - taskCompletionShouldRetry(data, response, error) { shouldRetry in - - if shouldRetry { - cleanupRequest() - self.execute(apiResponseQueue, completion) - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } - } - } - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() } } - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - onProgressReady?(dataTask.progress) - } + onProgressReady?(dataTask.progress) taskIdentifier = dataTask.taskIdentifier challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs.swift index ca48d19154cd..a1f97136a583 100644 --- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs.swift +++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs.swift @@ -7,14 +7,6 @@ import Foundation import Vapor - -// We reverted the change of PetstoreClientAPI to PetstoreClient introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 -// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 -// If you are affected by this issue, please consider removing the following two lines, -// By setting the option removeMigrationProjectNameClass to true in the generator -@available(*, deprecated, renamed: "PetstoreClientAPI") -public typealias PetstoreClient = PetstoreClientAPI - open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var customHeaders: HTTPHeaders = [:] diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs.swift index 8f74ebeeb74f..5f4f3c790ab8 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -5,14 +5,6 @@ // import Foundation - -// We reverted the change of PetstoreClientAPI to PetstoreClient introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 -// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 -// If you are affected by this issue, please consider removing the following two lines, -// By setting the option removeMigrationProjectNameClass to true in the generator -@available(*, deprecated, renamed: "PetstoreClientAPI") -public typealias PetstoreClient = PetstoreClientAPI - open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var customHeaders: [String: String] = [:] @@ -31,8 +23,6 @@ open class RequestBuilder { public let requiresAuthentication: Bool /// Optional block to obtain a reference to the request's progress instance when available. - /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. - /// If you need to get the request's progress in older OS versions, please use Alamofire http client. public var onProgressReady: ((Progress) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 03789f4b4925..df53ee090108 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -8,10 +8,6 @@ import Foundation open class Configuration { - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" /// Configures the range of HTTP status codes that will result in a successful response /// /// If a HTTP status code is outside of this range the response will be interpreted as failed. diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index da9dca29ac46..f04c90878cbb 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -52,7 +52,7 @@ open class URLSessionRequestBuilder: RequestBuilder { - intercept and handle errors like authorization - retry the request. */ - @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + @available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { @@ -141,32 +141,13 @@ open class URLSessionRequestBuilder: RequestBuilder { } let dataTask = urlSession.dataTask(with: request) { data, response, error in - - if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - - taskCompletionShouldRetry(data, response, error) { shouldRetry in - - if shouldRetry { - cleanupRequest() - self.execute(apiResponseQueue, completion) - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } - } - } - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - cleanupRequest() - } + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() } } - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - onProgressReady?(dataTask.progress) - } + onProgressReady?(dataTask.progress) taskIdentifier = dataTask.taskIdentifier challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge