Skip to content

Commit 9a3a907

Browse files
authored
fix: improve placeholder assignment in CodeSnippets component (#1256)
- Update the placeholder assignment logic to use find method for better accuracy. - Ensure the correct name is retrieved based on the key from authOptions.
1 parent 21222c0 commit 9a3a907

File tree

1 file changed

+1
-1
lines changed
  • packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/CodeSnippets

1 file changed

+1
-1
lines changed

packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/CodeSnippets/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function CodeSnippets({
7676
const authOptions =
7777
clonedAuth?.options?.[key] ??
7878
clonedAuth?.options?.[comboAuthId];
79-
placeholder = authOptions?.[0]?.name;
79+
placeholder = authOptions?.find((opt: any) => opt.key === key)?.name;
8080
obj[key] = cleanCredentials(obj[key]);
8181
} else {
8282
obj[key] = `<${placeholder ?? key}>`;

0 commit comments

Comments
 (0)