rusackas commented on code in PR #37434:
URL: https://github.com/apache/superset/pull/37434#discussion_r2733480648


##########
docs/docusaurus.config.ts:
##########
@@ -189,6 +195,29 @@ const config: Config = {
       },
     ],
     ...dynamicPlugins,
+    [
+      'docusaurus-plugin-openapi-docs',
+      {
+        id: 'api',
+        docsPluginId: 'classic',

Review Comment:
   This is a false positive. The `docsPluginId: 'classic'` is correct — the 
plugin resolves preset names using `endsWith()` matching, so `'classic'` 
matches `@docusaurus/preset-classic`. The API docs generate and build 
successfully with this configuration. See `getDocsPluginConfig()` in 
`docusaurus-plugin-openapi-docs/lib/index.js`.



##########
docs/sidebars.js:
##########
@@ -107,9 +107,14 @@ const sidebars = {
       id: 'faq',
     },
     {
-      type: 'doc',
-      label: 'API',
-      id: 'api',
+      type: 'category',
+      label: 'API Reference',
+      link: {
+        type: 'doc',
+        id: 'api',
+      },
+      // eslint-disable-next-line @typescript-eslint/no-require-imports
+      items: require('./docs/api/sidebar.js'),

Review Comment:
   Valid point — fixed. The `require()` is now wrapped in a try/catch that 
falls back to an empty array when `yarn generate:api-docs` has not been run 
yet. See 1c8a520.



##########
docs/src/styles/custom.css:
##########
@@ -187,3 +187,81 @@ ul.dropdown__menu svg {
 [data-theme='dark'] .ant-collapse-header {
   color: var(--ifm-font-base-color);
 }
+
+/* Hide the non-functional "Send API Request" button and Response block in API 
docs */
+/* The interactive API testing doesn't work due to CORS restrictions */
+.openapi-explorer__request-btn {
+  display: none !important;
+}
+
+.openapi-explorer__response-container {
+  display: none !important;

Review Comment:
   False positive. The `.openapi-explorer__response-container` class is used 
exclusively by the **interactive** "Send API Request" response panel (in 
`ApiExplorer/Response/index.js`), not the documented response schemas. The 
documented response status codes and schemas use 
`openapi-tabs__response-container` (in `ApiTabs/index.js`) which is not hidden. 
Additionally, we set `hideSendButton: true` in the plugin config, which causes 
the Response component to `return null` anyway — the CSS is defense-in-depth.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to