fix: use apikey name in header instead of securityDefinition spec id (#17022)

This commit is contained in:
Elon Mallin 2023-11-12 16:18:12 +01:00 committed by GitHub
parent 2b9ee8c5f6
commit 6917aad760
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,15 +178,15 @@ function {{{vendorExtensions.x-powershell-method-name}}} {
{{#authMethods}}
{{#isApiKey}}
{{#isKeyInHeader}}
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["{{{name}}}"]) {
$LocalVarHeaderParameters['{{{name}}}'] = $Configuration["ApiKey"]["{{{name}}}"]
Write-Verbose ("Using API key '{{{name}}}' in the header for authentication in {0}" -f $MyInvocation.MyCommand)
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["{{{keyParamName}}}"]) {
$LocalVarHeaderParameters['{{{keyParamName}}}'] = $Configuration["ApiKey"]["{{{keyParamName}}}"]
Write-Verbose ("Using API key '{{{keyParamName}}}' in the header for authentication in {0}" -f $MyInvocation.MyCommand)
}
{{/isKeyInHeader}}
{{#isKeyInQuery}}
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["{{{name}}}"]) {
$LocalVarQueryParameters['{{{name}}}'] = $Configuration["ApiKey"]["{{{name}}}"]
Write-Verbose ("Using API key `{{{name}}}` in the URL query for authentication in {0}" -f $MyInvocation.MyCommand)
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["{{{keyParamName}}}"]) {
$LocalVarQueryParameters['{{{keyParamName}}}'] = $Configuration["ApiKey"]["{{{keyParamName}}}"]
Write-Verbose ("Using API key `{{{keyParamName}}}` in the URL query for authentication in {0}" -f $MyInvocation.MyCommand)
}
{{/isKeyInQuery}}
{{#isKeyInCookie}}