forked from loafle/openapi-generator-original
[swift5] fix generation of multiple security definitions (#13617)
* uses correct variable to check for security definitions * update samples
This commit is contained in:
@@ -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}}
|
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}}
|
{{/useVapor}}
|
||||||
{{/operation}}
|
{{/operation}}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ paths:
|
|||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- 'write:pets'
|
- 'write:pets'
|
||||||
- 'read:pets'
|
- 'read:pets'
|
||||||
|
- api_key_query: []
|
||||||
put:
|
put:
|
||||||
tags:
|
tags:
|
||||||
- pet
|
- pet
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ open class PetAPI {
|
|||||||
/**
|
/**
|
||||||
Add a new pet to the store
|
Add a new pet to the store
|
||||||
- POST /pet
|
- POST /pet
|
||||||
|
- API Key:
|
||||||
|
- type: apiKey api_key_query (QUERY)
|
||||||
|
- name: api_key_query
|
||||||
- OAuth:
|
- OAuth:
|
||||||
- type: oauth2
|
- type: oauth2
|
||||||
- name: petstore_auth
|
- name: petstore_auth
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ Void (empty response body)
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ open class PetAPI {
|
|||||||
/**
|
/**
|
||||||
Add a new pet to the store
|
Add a new pet to the store
|
||||||
- POST /pet
|
- POST /pet
|
||||||
|
- API Key:
|
||||||
|
- type: apiKey api_key_query (QUERY)
|
||||||
|
- name: api_key_query
|
||||||
- OAuth:
|
- OAuth:
|
||||||
- type: oauth2
|
- type: oauth2
|
||||||
- name: petstore_auth
|
- name: petstore_auth
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ Void (empty response body)
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,9 @@ open class PetAPI {
|
|||||||
/**
|
/**
|
||||||
Add a new pet to the store
|
Add a new pet to the store
|
||||||
- POST /pet
|
- POST /pet
|
||||||
|
- API Key:
|
||||||
|
- type: apiKey api_key_query (QUERY)
|
||||||
|
- name: api_key_query
|
||||||
- OAuth:
|
- OAuth:
|
||||||
- type: oauth2
|
- type: oauth2
|
||||||
- name: petstore_auth
|
- name: petstore_auth
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ Void (empty response body)
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ open class PetAPI {
|
|||||||
/**
|
/**
|
||||||
Add a new pet to the store
|
Add a new pet to the store
|
||||||
- POST /pet
|
- POST /pet
|
||||||
|
- API Key:
|
||||||
|
- type: apiKey api_key_query (QUERY)
|
||||||
|
- name: api_key_query
|
||||||
- OAuth:
|
- OAuth:
|
||||||
- type: oauth2
|
- type: oauth2
|
||||||
- name: petstore_auth
|
- name: petstore_auth
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ Void (empty response body)
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ internal class PetAPI {
|
|||||||
/**
|
/**
|
||||||
Add a new pet to the store
|
Add a new pet to the store
|
||||||
- POST /pet
|
- POST /pet
|
||||||
|
- API Key:
|
||||||
|
- type: apiKey api_key_query (QUERY)
|
||||||
|
- name: api_key_query
|
||||||
- OAuth:
|
- OAuth:
|
||||||
- type: oauth2
|
- type: oauth2
|
||||||
- name: petstore_auth
|
- name: petstore_auth
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ Void (empty response body)
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ import AnyCodable
|
|||||||
/**
|
/**
|
||||||
Add a new pet to the store
|
Add a new pet to the store
|
||||||
- POST /pet
|
- POST /pet
|
||||||
|
- API Key:
|
||||||
|
- type: apiKey api_key_query (QUERY)
|
||||||
|
- name: api_key_query
|
||||||
- OAuth:
|
- OAuth:
|
||||||
- type: oauth2
|
- type: oauth2
|
||||||
- name: petstore_auth
|
- name: petstore_auth
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ Void (empty response body)
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ open class PetAPI {
|
|||||||
/**
|
/**
|
||||||
Add a new pet to the store
|
Add a new pet to the store
|
||||||
- POST /pet
|
- POST /pet
|
||||||
|
- API Key:
|
||||||
|
- type: apiKey api_key_query (QUERY)
|
||||||
|
- name: api_key_query
|
||||||
- OAuth:
|
- OAuth:
|
||||||
- type: oauth2
|
- type: oauth2
|
||||||
- name: petstore_auth
|
- name: petstore_auth
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ Void (empty response body)
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ open class PetAPI {
|
|||||||
/**
|
/**
|
||||||
Add a new pet to the store
|
Add a new pet to the store
|
||||||
- POST /pet
|
- POST /pet
|
||||||
|
- API Key:
|
||||||
|
- type: apiKey api_key_query (QUERY)
|
||||||
|
- name: api_key_query
|
||||||
- OAuth:
|
- OAuth:
|
||||||
- type: oauth2
|
- type: oauth2
|
||||||
- name: petstore_auth
|
- name: petstore_auth
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ Void (empty response body)
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ open class PetAPI {
|
|||||||
/**
|
/**
|
||||||
Add a new pet to the store
|
Add a new pet to the store
|
||||||
- POST /pet
|
- POST /pet
|
||||||
|
- API Key:
|
||||||
|
- type: apiKey api_key_query (QUERY)
|
||||||
|
- name: api_key_query
|
||||||
- OAuth:
|
- OAuth:
|
||||||
- type: oauth2
|
- type: oauth2
|
||||||
- name: petstore_auth
|
- name: petstore_auth
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ Void (empty response body)
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ open class PetAPI {
|
|||||||
/**
|
/**
|
||||||
Add a new pet to the store
|
Add a new pet to the store
|
||||||
- POST /pet
|
- POST /pet
|
||||||
|
- API Key:
|
||||||
|
- type: apiKey api_key_query (QUERY)
|
||||||
|
- name: api_key_query
|
||||||
- OAuth:
|
- OAuth:
|
||||||
- type: oauth2
|
- type: oauth2
|
||||||
- name: petstore_auth
|
- name: petstore_auth
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ Void (empty response body)
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ open class PetAPI {
|
|||||||
/**
|
/**
|
||||||
Add a new pet to the store
|
Add a new pet to the store
|
||||||
- POST /pet
|
- POST /pet
|
||||||
|
- API Key:
|
||||||
|
- type: apiKey api_key_query (QUERY)
|
||||||
|
- name: api_key_query
|
||||||
- OAuth:
|
- OAuth:
|
||||||
- type: oauth2
|
- type: oauth2
|
||||||
- name: petstore_auth
|
- name: petstore_auth
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ Void (empty response body)
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ open class PetAPI {
|
|||||||
/**
|
/**
|
||||||
Add a new pet to the store
|
Add a new pet to the store
|
||||||
- POST /pet
|
- POST /pet
|
||||||
|
- API Key:
|
||||||
|
- type: apiKey api_key_query (QUERY)
|
||||||
|
- name: api_key_query
|
||||||
- OAuth:
|
- OAuth:
|
||||||
- type: oauth2
|
- type: oauth2
|
||||||
- name: petstore_auth
|
- name: petstore_auth
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ Void (empty response body)
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[api_key_query](../README.md#api_key_query), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user