OpenAPI: Fix Scalar integration

This commit is contained in:
Fuma Nama
2025-11-07 22:02:09 +08:00
parent 9a6a7ccf6b
commit 2347d33f40
3 changed files with 10 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-openapi': patch
---
Fix Scalar integration
+2 -3
View File
@@ -9,6 +9,7 @@ import { MethodLabel } from '@/ui/components/method-label';
import { useTheme } from 'next-themes';
import { useEffect, useState } from 'react';
import type { OpenAPIV3_1 } from 'openapi-types';
import '@scalar/api-client-react/style.css';
export default function ScalarPlayground({
path,
@@ -40,9 +41,7 @@ export default function ScalarPlayground({
<ApiClientModalProvider
configuration={{
theme: 'moon',
spec: {
content: spec,
},
content: spec,
}}
>
<Trigger path={path} method={method} />
+3 -1
View File
@@ -4,7 +4,7 @@ import { lazy } from 'react';
const Client = lazy(() => import('./client'));
export function APIPlayground({
function APIPlayground({
path,
method,
ctx,
@@ -20,6 +20,8 @@ export function APIPlayground({
/**
* Enable Scalar for API playgrounds by wrapping your options inside.
*
* Requires `@scalar/api-client-react` to be installed, it imports the styles automatically.
*/
export function withScalar(
options: CreateAPIPageOptions = {},