forked from loafle/openapi-generator-original
[swift5] add credentials by default (#19906)
This commit is contained in:
parent
f6c0b4ad6b
commit
c6dbf0870c
@ -45,6 +45,7 @@ import Vapor
|
||||
self.requiresAuthentication = requiresAuthentication
|
||||
|
||||
addHeaders({{projectName}}API.customHeaders)
|
||||
addCredential()
|
||||
}
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func addHeaders(_ aHeaders: [String: String]) {
|
||||
@ -92,9 +93,8 @@ import Vapor
|
||||
return self
|
||||
}
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func addCredential() -> Self {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func addCredential() {
|
||||
credential = {{projectName}}API.credential
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ open class RequestBuilder<T> {
|
||||
self.requiresAuthentication = requiresAuthentication
|
||||
|
||||
addHeaders(PetstoreClientAPI.customHeaders)
|
||||
addCredential()
|
||||
}
|
||||
|
||||
open func addHeaders(_ aHeaders: [String: String]) {
|
||||
@ -56,9 +57,8 @@ open class RequestBuilder<T> {
|
||||
return self
|
||||
}
|
||||
|
||||
open func addCredential() -> Self {
|
||||
open func addCredential() {
|
||||
credential = PetstoreClientAPI.credential
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ open class RequestBuilder<T> {
|
||||
self.requiresAuthentication = requiresAuthentication
|
||||
|
||||
addHeaders(PetstoreClientAPI.customHeaders)
|
||||
addCredential()
|
||||
}
|
||||
|
||||
open func addHeaders(_ aHeaders: [String: String]) {
|
||||
@ -81,9 +82,8 @@ open class RequestBuilder<T> {
|
||||
return self
|
||||
}
|
||||
|
||||
open func addCredential() -> Self {
|
||||
open func addCredential() {
|
||||
credential = PetstoreClientAPI.credential
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ open class RequestBuilder<T> {
|
||||
self.requiresAuthentication = requiresAuthentication
|
||||
|
||||
addHeaders(PetstoreClientAPI.customHeaders)
|
||||
addCredential()
|
||||
}
|
||||
|
||||
open func addHeaders(_ aHeaders: [String: String]) {
|
||||
@ -56,9 +57,8 @@ open class RequestBuilder<T> {
|
||||
return self
|
||||
}
|
||||
|
||||
open func addCredential() -> Self {
|
||||
open func addCredential() {
|
||||
credential = PetstoreClientAPI.credential
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ open class RequestBuilder<T> {
|
||||
self.requiresAuthentication = requiresAuthentication
|
||||
|
||||
addHeaders(PetstoreClientAPI.customHeaders)
|
||||
addCredential()
|
||||
}
|
||||
|
||||
open func addHeaders(_ aHeaders: [String: String]) {
|
||||
@ -56,9 +57,8 @@ open class RequestBuilder<T> {
|
||||
return self
|
||||
}
|
||||
|
||||
open func addCredential() -> Self {
|
||||
open func addCredential() {
|
||||
credential = PetstoreClientAPI.credential
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ open class RequestBuilder<T> {
|
||||
self.requiresAuthentication = requiresAuthentication
|
||||
|
||||
addHeaders(PetstoreClientAPI.customHeaders)
|
||||
addCredential()
|
||||
}
|
||||
|
||||
open func addHeaders(_ aHeaders: [String: String]) {
|
||||
@ -56,9 +57,8 @@ open class RequestBuilder<T> {
|
||||
return self
|
||||
}
|
||||
|
||||
open func addCredential() -> Self {
|
||||
open func addCredential() {
|
||||
credential = PetstoreClientAPI.credential
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ open class RequestBuilder<T> {
|
||||
self.requiresAuthentication = requiresAuthentication
|
||||
|
||||
addHeaders(PetstoreClientAPI.customHeaders)
|
||||
addCredential()
|
||||
}
|
||||
|
||||
open func addHeaders(_ aHeaders: [String: String]) {
|
||||
@ -56,9 +57,8 @@ open class RequestBuilder<T> {
|
||||
return self
|
||||
}
|
||||
|
||||
open func addCredential() -> Self {
|
||||
open func addCredential() {
|
||||
credential = PetstoreClientAPI.credential
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ open class RequestBuilder<T> {
|
||||
self.requiresAuthentication = requiresAuthentication
|
||||
|
||||
addHeaders(PetstoreClientAPI.customHeaders)
|
||||
addCredential()
|
||||
}
|
||||
|
||||
open func addHeaders(_ aHeaders: [String: String]) {
|
||||
@ -56,9 +57,8 @@ open class RequestBuilder<T> {
|
||||
return self
|
||||
}
|
||||
|
||||
open func addCredential() -> Self {
|
||||
open func addCredential() {
|
||||
credential = PetstoreClientAPI.credential
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ internal class RequestBuilder<T> {
|
||||
self.requiresAuthentication = requiresAuthentication
|
||||
|
||||
addHeaders(PetstoreClientAPI.customHeaders)
|
||||
addCredential()
|
||||
}
|
||||
|
||||
internal func addHeaders(_ aHeaders: [String: String]) {
|
||||
@ -56,9 +57,8 @@ internal class RequestBuilder<T> {
|
||||
return self
|
||||
}
|
||||
|
||||
internal func addCredential() -> Self {
|
||||
internal func addCredential() {
|
||||
credential = PetstoreClientAPI.credential
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ open class RequestBuilder<T> {
|
||||
self.requiresAuthentication = requiresAuthentication
|
||||
|
||||
addHeaders(PetstoreClientAPI.customHeaders)
|
||||
addCredential()
|
||||
}
|
||||
|
||||
open func addHeaders(_ aHeaders: [String: String]) {
|
||||
@ -56,9 +57,8 @@ open class RequestBuilder<T> {
|
||||
return self
|
||||
}
|
||||
|
||||
open func addCredential() -> Self {
|
||||
open func addCredential() {
|
||||
credential = PetstoreClientAPI.credential
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ open class RequestBuilder<T> {
|
||||
self.requiresAuthentication = requiresAuthentication
|
||||
|
||||
addHeaders(PetstoreClientAPI.customHeaders)
|
||||
addCredential()
|
||||
}
|
||||
|
||||
open func addHeaders(_ aHeaders: [String: String]) {
|
||||
@ -56,9 +57,8 @@ open class RequestBuilder<T> {
|
||||
return self
|
||||
}
|
||||
|
||||
open func addCredential() -> Self {
|
||||
open func addCredential() {
|
||||
credential = PetstoreClientAPI.credential
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ open class RequestBuilder<T> {
|
||||
self.requiresAuthentication = requiresAuthentication
|
||||
|
||||
addHeaders(PetstoreClientAPI.customHeaders)
|
||||
addCredential()
|
||||
}
|
||||
|
||||
open func addHeaders(_ aHeaders: [String: String]) {
|
||||
@ -56,9 +57,8 @@ open class RequestBuilder<T> {
|
||||
return self
|
||||
}
|
||||
|
||||
open func addCredential() -> Self {
|
||||
open func addCredential() {
|
||||
credential = PetstoreClientAPI.credential
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user