mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
OpenAPI: Fix custom name in apiKey type authorization being ignored
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-openapi': patch
|
||||
---
|
||||
|
||||
Fix custom name in `apiKey` type authorization being ignored
|
||||
@@ -145,7 +145,7 @@ function getAuthorizationField(
|
||||
|
||||
return {
|
||||
type: 'string',
|
||||
name: 'Authorization',
|
||||
name: scheme.type === 'apiKey' ? scheme.name : 'Authorization',
|
||||
authType: scheme.type,
|
||||
defaultValue:
|
||||
scheme.type === 'oauth2' ||
|
||||
|
||||
@@ -90,8 +90,8 @@ export function APIPlayground({
|
||||
if (bodyType !== 'form-data')
|
||||
headers.append('Content-Type', 'application/json');
|
||||
|
||||
if (input.authorization) {
|
||||
headers.append('Authorization', input.authorization);
|
||||
if (input.authorization && authorization) {
|
||||
headers.append(authorization.name, input.authorization);
|
||||
}
|
||||
|
||||
Object.keys(input.header).forEach((key) => {
|
||||
|
||||
Reference in New Issue
Block a user