forked from loafle/openapi-generator-original
fix: use apikey name in header instead of securityDefinition spec id (#17022)
This commit is contained in:
parent
2b9ee8c5f6
commit
6917aad760
@ -178,15 +178,15 @@ function {{{vendorExtensions.x-powershell-method-name}}} {
|
|||||||
{{#authMethods}}
|
{{#authMethods}}
|
||||||
{{#isApiKey}}
|
{{#isApiKey}}
|
||||||
{{#isKeyInHeader}}
|
{{#isKeyInHeader}}
|
||||||
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["{{{name}}}"]) {
|
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["{{{keyParamName}}}"]) {
|
||||||
$LocalVarHeaderParameters['{{{name}}}'] = $Configuration["ApiKey"]["{{{name}}}"]
|
$LocalVarHeaderParameters['{{{keyParamName}}}'] = $Configuration["ApiKey"]["{{{keyParamName}}}"]
|
||||||
Write-Verbose ("Using API key '{{{name}}}' in the header for authentication in {0}" -f $MyInvocation.MyCommand)
|
Write-Verbose ("Using API key '{{{keyParamName}}}' in the header for authentication in {0}" -f $MyInvocation.MyCommand)
|
||||||
}
|
}
|
||||||
{{/isKeyInHeader}}
|
{{/isKeyInHeader}}
|
||||||
{{#isKeyInQuery}}
|
{{#isKeyInQuery}}
|
||||||
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["{{{name}}}"]) {
|
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["{{{keyParamName}}}"]) {
|
||||||
$LocalVarQueryParameters['{{{name}}}'] = $Configuration["ApiKey"]["{{{name}}}"]
|
$LocalVarQueryParameters['{{{keyParamName}}}'] = $Configuration["ApiKey"]["{{{keyParamName}}}"]
|
||||||
Write-Verbose ("Using API key `{{{name}}}` in the URL query for authentication in {0}" -f $MyInvocation.MyCommand)
|
Write-Verbose ("Using API key `{{{keyParamName}}}` in the URL query for authentication in {0}" -f $MyInvocation.MyCommand)
|
||||||
}
|
}
|
||||||
{{/isKeyInQuery}}
|
{{/isKeyInQuery}}
|
||||||
{{#isKeyInCookie}}
|
{{#isKeyInCookie}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user