diff --git a/modules/openapi-generator/src/main/resources/swift5/api.mustache b/modules/openapi-generator/src/main/resources/swift5/api.mustache index d87c21456576..6021e7fb7635 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api.mustache @@ -466,7 +466,7 @@ extension {{projectName}}API { let localVariableRequestBuilder: RequestBuilder<{{{returnType}}}{{#returnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{^returnType}}Void{{/returnType}}>.Type = {{projectName}}API.requestBuilderFactory.{{#returnType}}getBuilder(){{/returnType}}{{^returnType}}getNonDecodableBuilder(){{/returnType}} - return localVariableRequestBuilder.init(method: "{{httpMethod}}", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: {{#authMethods}}true{{/authMethods}}{{^authMethods}}false{{/authMethods}}) + return localVariableRequestBuilder.init(method: "{{httpMethod}}", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: {{#hasAuthMethods}}true{{/hasAuthMethods}}{{^hasAuthMethods}}false{{/hasAuthMethods}}) } {{/useVapor}} {{/operation}} diff --git a/modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml index 588fde8671cf..dac5c2a933a3 100644 --- a/modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml @@ -45,6 +45,7 @@ paths: - petstore_auth: - 'write:pets' - 'read:pets' + - api_key_query: [] put: tags: - pet diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 49c3d42204b3..93671ed852a9 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -34,6 +34,9 @@ open class PetAPI { /** Add a new pet to the store - POST /pet + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift5/alamofireLibrary/docs/PetAPI.md b/samples/client/petstore/swift5/alamofireLibrary/docs/PetAPI.md index 7dc73a98900d..786640dabb80 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/docs/PetAPI.md +++ b/samples/client/petstore/swift5/alamofireLibrary/docs/PetAPI.md @@ -54,7 +54,7 @@ Void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 21e09a2c1e07..5a3ff6c4600a 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -46,6 +46,9 @@ open class PetAPI { /** Add a new pet to the store - POST /pet + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/docs/PetAPI.md b/samples/client/petstore/swift5/asyncAwaitLibrary/docs/PetAPI.md index 7dc73a98900d..786640dabb80 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/docs/PetAPI.md +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/docs/PetAPI.md @@ -54,7 +54,7 @@ Void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 52a127a87f3c..a9033a06cc3e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -45,6 +45,9 @@ open class PetAPI { /** Add a new pet to the store - POST /pet + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift5/combineLibrary/docs/PetAPI.md b/samples/client/petstore/swift5/combineLibrary/docs/PetAPI.md index 7dc73a98900d..786640dabb80 100644 --- a/samples/client/petstore/swift5/combineLibrary/docs/PetAPI.md +++ b/samples/client/petstore/swift5/combineLibrary/docs/PetAPI.md @@ -54,7 +54,7 @@ Void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index a46f7d72eafa..054422bbe342 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -34,6 +34,9 @@ open class PetAPI { /** Add a new pet to the store - POST /pet + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift5/frozenEnums/docs/PetAPI.md b/samples/client/petstore/swift5/frozenEnums/docs/PetAPI.md index 37226f18b855..7db99cf83761 100644 --- a/samples/client/petstore/swift5/frozenEnums/docs/PetAPI.md +++ b/samples/client/petstore/swift5/frozenEnums/docs/PetAPI.md @@ -54,7 +54,7 @@ Void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 6c29ed5643ba..143d7aa284c1 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -34,6 +34,9 @@ internal class PetAPI { /** Add a new pet to the store - POST /pet + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift5/nonPublicApi/docs/PetAPI.md b/samples/client/petstore/swift5/nonPublicApi/docs/PetAPI.md index a9e13c339cfd..8635a4c340b5 100644 --- a/samples/client/petstore/swift5/nonPublicApi/docs/PetAPI.md +++ b/samples/client/petstore/swift5/nonPublicApi/docs/PetAPI.md @@ -54,7 +54,7 @@ Void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index b2631928c28d..06cdfc06cc75 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -34,6 +34,9 @@ import AnyCodable /** Add a new pet to the store - POST /pet + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift5/objcCompatible/docs/PetAPI.md b/samples/client/petstore/swift5/objcCompatible/docs/PetAPI.md index 5e6bccd7eaa2..571bcd0fbca2 100644 --- a/samples/client/petstore/swift5/objcCompatible/docs/PetAPI.md +++ b/samples/client/petstore/swift5/objcCompatible/docs/PetAPI.md @@ -54,7 +54,7 @@ Void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 2781e3f0187b..51ed84dfc826 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -35,6 +35,9 @@ open class PetAPI { /** Add a new pet to the store - POST /pet + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift5/promisekitLibrary/docs/PetAPI.md b/samples/client/petstore/swift5/promisekitLibrary/docs/PetAPI.md index 41d27fed4e70..419776868ad2 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/docs/PetAPI.md +++ b/samples/client/petstore/swift5/promisekitLibrary/docs/PetAPI.md @@ -51,7 +51,7 @@ Void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 49c3d42204b3..93671ed852a9 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -34,6 +34,9 @@ open class PetAPI { /** Add a new pet to the store - POST /pet + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift5/readonlyProperties/docs/PetAPI.md b/samples/client/petstore/swift5/readonlyProperties/docs/PetAPI.md index 7dc73a98900d..786640dabb80 100644 --- a/samples/client/petstore/swift5/readonlyProperties/docs/PetAPI.md +++ b/samples/client/petstore/swift5/readonlyProperties/docs/PetAPI.md @@ -54,7 +54,7 @@ Void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index eb575f5a3651..f685b49335c1 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -34,6 +34,9 @@ open class PetAPI { /** Add a new pet to the store - POST /pet + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift5/resultLibrary/docs/PetAPI.md b/samples/client/petstore/swift5/resultLibrary/docs/PetAPI.md index 7dc73a98900d..786640dabb80 100644 --- a/samples/client/petstore/swift5/resultLibrary/docs/PetAPI.md +++ b/samples/client/petstore/swift5/resultLibrary/docs/PetAPI.md @@ -54,7 +54,7 @@ Void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index b6415d0f1a28..2426be2a7730 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -41,6 +41,9 @@ open class PetAPI { /** Add a new pet to the store - POST /pet + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift5/rxswiftLibrary/docs/PetAPI.md b/samples/client/petstore/swift5/rxswiftLibrary/docs/PetAPI.md index 9f9a42ca4f56..c376190fb6d5 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/docs/PetAPI.md +++ b/samples/client/petstore/swift5/rxswiftLibrary/docs/PetAPI.md @@ -44,7 +44,7 @@ Void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index 61e9124c20cb..1d2a16db1df1 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -37,6 +37,9 @@ open class PetAPI { /** Add a new pet to the store - POST /pet + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift5/urlsessionLibrary/docs/PetAPI.md b/samples/client/petstore/swift5/urlsessionLibrary/docs/PetAPI.md index 7dc73a98900d..786640dabb80 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/docs/PetAPI.md +++ b/samples/client/petstore/swift5/urlsessionLibrary/docs/PetAPI.md @@ -54,7 +54,7 @@ Void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 49c3d42204b3..93671ed852a9 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -34,6 +34,9 @@ open class PetAPI { /** Add a new pet to the store - POST /pet + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift5/x-swift-hashable/docs/PetAPI.md b/samples/client/petstore/swift5/x-swift-hashable/docs/PetAPI.md index 7dc73a98900d..786640dabb80 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/docs/PetAPI.md +++ b/samples/client/petstore/swift5/x-swift-hashable/docs/PetAPI.md @@ -54,7 +54,7 @@ Void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers