#3607·fumadocs

[Bug][OpenAPI] Playground auth selector renders security scheme `description` as raw text instead of Markdown

Author: mehnoorsiddiquiCreated Sep 29, 2026Updated Sep 29, 2026

To Reproduce

  1. Use an OpenAPI document whose security scheme has a Markdown description:

    yaml
    openapi: 3.0.3
    info: { title: Repro, version: 1.0.0 }
    components:
      securitySchemes:
        apiToken:
          type: apiKey
          in: header
          name: X-API-Token
          description: |
            **Format**: `Token <value>`
    
            * Get a token from the dashboard
            * Tokens expire after 30 days
    security:
      - apiToken: []
    paths:
      /items:
        get:
          operationId: listItems
          responses:
            '200': { description: OK }
  2. Open the listItems page.

  3. In the playground, open the Authorization panel and expand the security scheme dropdown.

Current vs. Expected behavior

Current: The description appears as literal text. **Format**:, the backticks and the * bullets all show as typed. Line breaks are kept (whitespace-pre-wrap), but no Markdown is parsed.

Expected: The description renders as Markdown, as it already does in the operation's auth section on the same page.

Framework

Tanstack Start

Provide environment information

bash
Framework: TanStack Start 1.168.50 (@tanstack/react-router 1.170.33), Vite 8.2.2
Operating System:
  Platform: win32
Binaries:
  Node: 24.12.0
Relevant Packages:
  fumadocs-core: 16.15.15
  fumadocs-ui: 16.15.15
  fumadocs-mdx: 15.4.0
  fumadocs-openapi: 11.4.1
  react: 19.2.8
  react-dom: 19.2.8

Which area(s) are affected? (Select all that apply)

Integrations (e.g OpenAPI, Typescript DocsGen)

Additional context

Observed on the versions above. The same code is in fumadocs-openapi 12.0.4 and on dev as of 1bc5374; source paths are relative to packages/ on that commit.

In SecurityRequirements (openapi/src/ui/playground/client.tsx), the description is passed straight in as children:

  • Single requirement (line 358): <p className="text-fd-muted-foreground whitespace-pre-wrap">{scheme.description}</p>
  • Combined requirements (line 383): <li className="empty:hidden">{item.scheme.description}</li>

The operation auth section (openapi/src/ui/operation/index.tsx) renders the same field with <Markdown md={scheme.description} />. A possible fix:

  • Use <Markdown md={scheme.description} /> in both places.
  • Swap the wrapping <p> for a <div>, because Markdown output contains block elements (<p>, <ul>) that can't nest inside a <p>.

playground.components only exposes ResultDisplay and CollapsiblePanel, and neither covers the auth selector, so apps can't work around this.