Skip to content

fix(theme): use matching auth scheme name in code snippet placeholders - #1256

Merged
sserrata merged 1 commit into
PaloAltoNetworks:mainfrom
Revisto:fix-auth-placeholder-in-code-snippets
Dec 17, 2025
Merged

sserrata merged 1 commit into
PaloAltoNetworks:mainfrom
Revisto:fix-auth-placeholder-in-code-snippets

Conversation

@Revisto

@Revisto Revisto commented Dec 2, 2025 •

Copy link
Copy Markdown
Contributor

Description

Changed authOptions?.[0]?.name to authOptions?.find((opt: any) => opt.key === key)?.name to find the correct auth scheme by key instead of always picking the first one.

Motivation and Context

Fixes #1255

When an endpoint requires multiple auth schemes together (e.g. API Key + OAuth), the code snippet placeholder was always using the first scheme's name. This caused OAuth Bearer token to show <X-API-Key> instead of the OAuth scheme's configured name.

How Has This Been Tested?

Tested locally with an OpenAPI spec that has both APIKey and OAuth security schemes required together on an endpoint. Verified the example now shows the correct placeholder for each scheme.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

- Update the placeholder assignment logic to use find method for better accuracy.
- Ensure the correct name is retrieved based on the key from authOptions.
@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 9364c8a):

https://docusaurus-openapi-36b86--pr1256-25czq83b.web.app

(expires Thu, 15 Jan 2026 22:19:13 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bf293780ee827f578864d92193b8c2866acd459f

@sserrata
sserrata merged commit 9a3a907 into PaloAltoNetworks:main Dec 17, 2025

This branch was previously deployed

1 inactive deployment
default — 9364c8a2 Deployed Dec 2, 2025 by Revisto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code snippet shows wrong placeholder when multiple auth schemes are required

2 participants