From 38dac13c261d26a72be78bba89ee4a681843e7b0 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:38:49 +0100 Subject: [PATCH] [swift6] add credentials by default (#19885) --- .../openapi-generator/src/main/resources/swift6/APIs.mustache | 4 ++-- .../Sources/PetstoreClient/Infrastructure/APIs.swift | 4 ++-- .../Sources/PetstoreClient/Infrastructure/APIs.swift | 4 ++-- .../Sources/PetstoreClient/Infrastructure/APIs.swift | 4 ++-- .../PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift | 4 ++-- .../Sources/CombineLibrary/Infrastructure/APIs.swift | 4 ++-- .../default/Sources/PetstoreClient/Infrastructure/APIs.swift | 4 ++-- .../Sources/PetstoreClient/Infrastructure/APIs.swift | 4 ++-- .../PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift | 4 ++-- .../PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift | 4 ++-- .../PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift | 4 ++-- .../PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift | 4 ++-- .../Sources/PetstoreClient/Infrastructure/APIs.swift | 4 ++-- .../PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift | 4 ++-- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift6/APIs.mustache b/modules/openapi-generator/src/main/resources/swift6/APIs.mustache index 55ed0a08b51d..c0080c12ba2e 100644 --- a/modules/openapi-generator/src/main/resources/swift6/APIs.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/APIs.mustache @@ -104,6 +104,7 @@ import Alamofire{{/useAlamofire}} self.openAPIClient = openAPIClient addHeaders(openAPIClient.customHeaders) + addCredential() } {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func addHeaders(_ aHeaders: [String: String]) { @@ -161,9 +162,8 @@ import Alamofire{{/useAlamofire}} return self } - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func addCredential() -> Self { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func addCredential() { credential = openAPIClient.credential - return self } } diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift index cc25ab3ee266..a5313388c633 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift @@ -83,6 +83,7 @@ open class RequestBuilder: @unchecked Sendable { self.openAPIClient = openAPIClient addHeaders(openAPIClient.customHeaders) + addCredential() } open func addHeaders(_ aHeaders: [String: String]) { @@ -103,9 +104,8 @@ open class RequestBuilder: @unchecked Sendable { return self } - open func addCredential() -> Self { + open func addCredential() { credential = openAPIClient.credential - return self } } diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIs.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIs.swift index 52ff5ed4ba1d..2beb10b49b36 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIs.swift @@ -83,6 +83,7 @@ open class RequestBuilder: @unchecked Sendable { self.openAPIClient = openAPIClient addHeaders(openAPIClient.customHeaders) + addCredential() } open func addHeaders(_ aHeaders: [String: String]) { @@ -138,9 +139,8 @@ open class RequestBuilder: @unchecked Sendable { return self } - open func addCredential() -> Self { + open func addCredential() { credential = openAPIClient.credential - return self } } diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift index d4ad3ddd865a..780dd6dd1a52 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift @@ -69,6 +69,7 @@ open class RequestBuilder: @unchecked Sendable { self.openAPIClient = openAPIClient addHeaders(openAPIClient.customHeaders) + addCredential() } open func addHeaders(_ aHeaders: [String: String]) { @@ -124,9 +125,8 @@ open class RequestBuilder: @unchecked Sendable { return self } - open func addCredential() -> Self { + open func addCredential() { credential = openAPIClient.credential - return self } } diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift index 536818633805..c3acec934bb2 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift @@ -69,6 +69,7 @@ open class RequestBuilder: @unchecked Sendable { self.openAPIClient = openAPIClient addHeaders(openAPIClient.customHeaders) + addCredential() } open func addHeaders(_ aHeaders: [String: String]) { @@ -89,9 +90,8 @@ open class RequestBuilder: @unchecked Sendable { return self } - open func addCredential() -> Self { + open func addCredential() { credential = openAPIClient.credential - return self } } diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/APIs.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/APIs.swift index 536818633805..c3acec934bb2 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/APIs.swift @@ -69,6 +69,7 @@ open class RequestBuilder: @unchecked Sendable { self.openAPIClient = openAPIClient addHeaders(openAPIClient.customHeaders) + addCredential() } open func addHeaders(_ aHeaders: [String: String]) { @@ -89,9 +90,8 @@ open class RequestBuilder: @unchecked Sendable { return self } - open func addCredential() -> Self { + open func addCredential() { credential = openAPIClient.credential - return self } } diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIs.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIs.swift index d4ad3ddd865a..780dd6dd1a52 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIs.swift @@ -69,6 +69,7 @@ open class RequestBuilder: @unchecked Sendable { self.openAPIClient = openAPIClient addHeaders(openAPIClient.customHeaders) + addCredential() } open func addHeaders(_ aHeaders: [String: String]) { @@ -124,9 +125,8 @@ open class RequestBuilder: @unchecked Sendable { return self } - open func addCredential() -> Self { + open func addCredential() { credential = openAPIClient.credential - return self } } diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/APIs.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/APIs.swift index 536818633805..c3acec934bb2 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/APIs.swift @@ -69,6 +69,7 @@ open class RequestBuilder: @unchecked Sendable { self.openAPIClient = openAPIClient addHeaders(openAPIClient.customHeaders) + addCredential() } open func addHeaders(_ aHeaders: [String: String]) { @@ -89,9 +90,8 @@ open class RequestBuilder: @unchecked Sendable { return self } - open func addCredential() -> Self { + open func addCredential() { credential = openAPIClient.credential - return self } } diff --git a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift index f16a75b3232a..4cdb41e1204e 100644 --- a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift @@ -69,6 +69,7 @@ open class RequestBuilder: @unchecked Sendable { self.openAPIClient = openAPIClient addHeaders(openAPIClient.customHeaders) + addCredential() } open func addHeaders(_ aHeaders: [String: String]) { @@ -89,9 +90,8 @@ open class RequestBuilder: @unchecked Sendable { return self } - open func addCredential() -> Self { + open func addCredential() { credential = openAPIClient.credential - return self } } diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift index 536818633805..c3acec934bb2 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift @@ -69,6 +69,7 @@ open class RequestBuilder: @unchecked Sendable { self.openAPIClient = openAPIClient addHeaders(openAPIClient.customHeaders) + addCredential() } open func addHeaders(_ aHeaders: [String: String]) { @@ -89,9 +90,8 @@ open class RequestBuilder: @unchecked Sendable { return self } - open func addCredential() -> Self { + open func addCredential() { credential = openAPIClient.credential - return self } } diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift index 48912d8a359e..7d8c0e7aaea0 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift @@ -69,6 +69,7 @@ internal class RequestBuilder: @unchecked Sendable { self.openAPIClient = openAPIClient addHeaders(openAPIClient.customHeaders) + addCredential() } internal func addHeaders(_ aHeaders: [String: String]) { @@ -89,9 +90,8 @@ internal class RequestBuilder: @unchecked Sendable { return self } - internal func addCredential() -> Self { + internal func addCredential() { credential = openAPIClient.credential - return self } } diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift index 536818633805..c3acec934bb2 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift @@ -69,6 +69,7 @@ open class RequestBuilder: @unchecked Sendable { self.openAPIClient = openAPIClient addHeaders(openAPIClient.customHeaders) + addCredential() } open func addHeaders(_ aHeaders: [String: String]) { @@ -89,9 +90,8 @@ open class RequestBuilder: @unchecked Sendable { return self } - open func addCredential() -> Self { + open func addCredential() { credential = openAPIClient.credential - return self } } diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift index 652242770429..86016f1efe9d 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/APIs.swift @@ -71,6 +71,7 @@ open class RequestBuilder: @unchecked Sendable { self.openAPIClient = openAPIClient addHeaders(openAPIClient.customHeaders) + addCredential() } open func addHeaders(_ aHeaders: [String: String]) { @@ -91,9 +92,8 @@ open class RequestBuilder: @unchecked Sendable { return self } - open func addCredential() -> Self { + open func addCredential() { credential = openAPIClient.credential - return self } } diff --git a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift index 362d9ce5333f..78354f007898 100644 --- a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift +++ b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIs.swift @@ -69,6 +69,7 @@ open class RequestBuilder: @unchecked Sendable { self.openAPIClient = openAPIClient addHeaders(openAPIClient.customHeaders) + addCredential() } open func addHeaders(_ aHeaders: [String: String]) { @@ -124,9 +125,8 @@ open class RequestBuilder: @unchecked Sendable { return self } - open func addCredential() -> Self { + open func addCredential() { credential = openAPIClient.credential - return self } }