Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions demo/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ const config: Config = {
groupPathsBy: "tag",
},
showSchemas: true,
showInfoPage: false, // Disable info page generation
} satisfies OpenApiPlugin.Options,
tests: {
specPath: "examples/tests",
Expand Down
2 changes: 2 additions & 0 deletions packages/docusaurus-plugin-openapi-docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ The `docusaurus-plugin-openapi-docs` plugin can be configured with the following
| `versions` | `object` | `null` | _Optional:_ Options for versioning configuration. See below for a list of supported options. |
| `markdownGenerators` | `object` | `null` | _Optional:_ Customize MDX content via generator functions. See below for a list of supported options. |
| `showSchemas` | `boolean` | `null` | _Optional:_ If set to `true`, generates standalone schema pages and adds them to the sidebar. |
| `showInfoPage` | `boolean` | `true` | _Optional:_ If set to `false`, disables generation of the info page (overview page with API title and description). |
| `schemasOnly` | `boolean` | `false` | _Optional:_ If set to `true`, generates only schema pages (no API endpoint pages). Also available as `--schemas-only` CLI flag. |

### sidebarOptions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ function createItems(
const infoId = kebabCase(infoIdSpaces);
const schemasOnly = options?.schemasOnly === true;

if (openapiData.info.description || openapiData.info.title) {
// Only create an info page if we have a description.
// Only create an info page if we have a description/title AND showInfoPage is not false
if (
(openapiData.info.description || openapiData.info.title) &&
options?.showInfoPage !== false
) {
const infoDescription = openapiData.info?.description;
let splitDescription: any;
if (infoDescription) {
Expand Down
2 changes: 2 additions & 0 deletions packages/docusaurus-plugin-openapi-docs/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export const OptionsSchema = Joi.object({
sidebarOptions: sidebarOptions,
markdownGenerators: markdownGenerators,
showSchemas: Joi.boolean(),
showInfoPage: Joi.boolean(),
schemasOnly: Joi.boolean(),
disableCompression: Joi.boolean(),
maskCredentials: Joi.boolean(),
version: Joi.string().when("versions", {
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-openapi-docs/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface APIOptions {
proxy?: string;
markdownGenerators?: MarkdownGenerator;
showSchemas?: boolean;
showInfoPage?: boolean;
schemasOnly?: boolean;
disableCompression?: boolean;
maskCredentials?: boolean;
Expand Down