Skip to content

Commit 4c76590

Browse files
B4nanclaude
andcommitted
fix: render API doc response examples and schemas in SSR for .md export
The llms-txt plugin generates .md files from static HTML, but three OpenAPI theme components (ResponseSchema, ParamsDetails, RequestSchema) were wrapped in BrowserOnly, rendering only skeleton placeholders during SSR. This removed the BrowserOnly wrapper so the full content renders server-side and appears in the .md exports. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 44828c4 commit 4c76590

File tree

1 file changed

+72
-1
lines changed

1 file changed

+72
-1
lines changed

patches/docusaurus-theme-openapi-docs+4.7.1.patch

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,58 @@ index f6052d1..867bfd2 100644
227227
),
228228
react_1.default.createElement(
229229
"div",
230+
diff --git a/node_modules/docusaurus-theme-openapi-docs/lib/theme/ParamsDetails/index.js b/node_modules/docusaurus-theme-openapi-docs/lib/theme/ParamsDetails/index.js
231+
index b4bb17a..01ef6b8 100644
232+
--- a/node_modules/docusaurus-theme-openapi-docs/lib/theme/ParamsDetails/index.js
233+
+++ b/node_modules/docusaurus-theme-openapi-docs/lib/theme/ParamsDetails/index.js
234+
@@ -76,18 +76,7 @@ const ParamsDetailsComponent = ({ parameters }) => {
235+
);
236+
};
237+
const ParamsDetails = (props) => {
238+
- return react_1.default.createElement(
239+
- BrowserOnly_1.default,
240+
- {
241+
- fallback: react_1.default.createElement(SkeletonLoader_1.default, {
242+
- size: "sm",
243+
- }),
244+
- },
245+
- () => {
246+
- return react_1.default.createElement(ParamsDetailsComponent, {
247+
- ...props,
248+
- });
249+
- }
250+
- );
251+
+ // Apify: Render directly instead of BrowserOnly to make content available in SSR HTML for llms-txt plugin
252+
+ return react_1.default.createElement(ParamsDetailsComponent, { ...props });
253+
};
254+
exports.default = ParamsDetails;
255+
diff --git a/node_modules/docusaurus-theme-openapi-docs/lib/theme/RequestSchema/index.js b/node_modules/docusaurus-theme-openapi-docs/lib/theme/RequestSchema/index.js
256+
index aab2db8..4668eac 100644
257+
--- a/node_modules/docusaurus-theme-openapi-docs/lib/theme/RequestSchema/index.js
258+
+++ b/node_modules/docusaurus-theme-openapi-docs/lib/theme/RequestSchema/index.js
259+
@@ -197,18 +197,7 @@ const RequestSchemaComponent = ({ title, body, style }) => {
260+
);
261+
};
262+
const RequestSchema = (props) => {
263+
- return react_1.default.createElement(
264+
- BrowserOnly_1.default,
265+
- {
266+
- fallback: react_1.default.createElement(SkeletonLoader_1.default, {
267+
- size: "sm",
268+
- }),
269+
- },
270+
- () => {
271+
- return react_1.default.createElement(RequestSchemaComponent, {
272+
- ...props,
273+
- });
274+
- }
275+
- );
276+
+ // Apify: Render directly instead of BrowserOnly to make content available in SSR HTML for llms-txt plugin
277+
+ return react_1.default.createElement(RequestSchemaComponent, { ...props });
278+
};
279+
exports.default = RequestSchema;
230280
diff --git a/node_modules/docusaurus-theme-openapi-docs/lib/theme/ResponseSchema/index.js b/node_modules/docusaurus-theme-openapi-docs/lib/theme/ResponseSchema/index.js
231-
index e84857b..ba445e8 100644
281+
index e84857b..404c0a6 100644
232282
--- a/node_modules/docusaurus-theme-openapi-docs/lib/theme/ResponseSchema/index.js
233283
+++ b/node_modules/docusaurus-theme-openapi-docs/lib/theme/ResponseSchema/index.js
234284
@@ -64,6 +64,8 @@ const ResponseSchemaComponent = ({ title, body, style }) => {
@@ -290,6 +340,27 @@ index e84857b..ba445e8 100644
290340
)
291341
)
292342
);
343+
@@ -157,18 +163,7 @@ const ResponseSchemaComponent = ({ title, body, style }) => {
344+
return undefined;
345+
};
346+
const ResponseSchema = (props) => {
347+
- return react_1.default.createElement(
348+
- BrowserOnly_1.default,
349+
- {
350+
- fallback: react_1.default.createElement(SkeletonLoader_1.default, {
351+
- size: "md",
352+
- }),
353+
- },
354+
- () => {
355+
- return react_1.default.createElement(ResponseSchemaComponent, {
356+
- ...props,
357+
- });
358+
- }
359+
- );
360+
+ // Apify: Render directly instead of BrowserOnly to make content available in SSR HTML for llms-txt plugin
361+
+ return react_1.default.createElement(ResponseSchemaComponent, { ...props });
362+
};
363+
exports.default = ResponseSchema;
293364
diff --git a/node_modules/docusaurus-theme-openapi-docs/lib/theme/Schema/index.js b/node_modules/docusaurus-theme-openapi-docs/lib/theme/Schema/index.js
294365
index 37190c6..76766ef 100644
295366
--- a/node_modules/docusaurus-theme-openapi-docs/lib/theme/Schema/index.js

0 commit comments

Comments
 (0)