Skip to content

Commit 150c61d

Browse files
committed
docs: sync README and intro.mdx with plugin docs
- Add missing options to config tables (showInfoPage, schemasOnly, maskCredentials) - Add Performance Optimization section explaining externalJsonProps
1 parent 0153a40 commit 150c61d

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ The `docusaurus-plugin-openapi-docs` plugin can be configured with the following
174174
| `versions` | `object` | `null` | _Optional:_ Options for versioning configuration. See below for a list of supported options. |
175175
| `markdownGenerators` | `object` | `null` | _Optional:_ Customize MDX content via generator functions. See below for a list of supported options. |
176176
| `showSchemas` | `boolean` | `null` | _Optional:_ If set to `true`, generates standalone schema pages and adds them to the sidebar. |
177+
| `showInfoPage` | `boolean` | `true` | _Optional:_ If set to `false`, disables generation of the info page (overview page with API title and description). |
178+
| `schemasOnly` | `boolean` | `false` | _Optional:_ If set to `true`, generates only schema pages (no API endpoint pages). Also available as `--schemas-only` CLI flag. |
179+
| `maskCredentials` | `boolean` | `true` | _Optional:_ If set to `false`, disables credential masking in generated code snippets. By default, credentials are masked for security. |
177180
| `externalJsonProps` | `boolean` | `true` | _Optional:_ If set to `false`, disables externalization of large JSON props. By default, large JSON is written to external files for better build performance. |
178181

179182
### sidebarOptions
@@ -222,6 +225,28 @@ The `docusaurus-plugin-openapi-docs` plugin can be configured with the following
222225
| --------------- | ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
223226
| `createDocItem` | `function` | `null` | Optional: Returns a `SidebarItemDoc` object containing metadata for a sidebar item.<br/><br/>**Function type:** `(item: ApiPageMetadata \| SchemaPageMetadata, context: { sidebarOptions: SidebarOptions; basePath: string }) => SidebarItemDoc` |
224227

228+
### Performance Optimization
229+
230+
By default, `externalJsonProps` is enabled to optimize Docusaurus build times. This externalizes large JSON objects to separate files, significantly improving build performance for large OpenAPI specs.
231+
232+
**How it works:**
233+
234+
- With `externalJsonProps: true` (default): Large JSON props are written to separate `.json` files and loaded via `require()`. This bypasses MDX AST processing entirely, allowing the bundler to handle JSON more efficiently.
235+
236+
- With `externalJsonProps: false`: Large JSON objects (responses, request bodies, parameters) are embedded directly in the MDX. The MDX compiler must parse these into an AST and serialize them back, which can be slow for deeply nested schemas.
237+
238+
**When to disable:**
239+
240+
You may set `externalJsonProps: false` if you have custom tooling that depends on parsing the MDX files directly:
241+
242+
```typescript
243+
petstore: {
244+
specPath: "examples/petstore.yaml",
245+
outputDir: "docs/petstore",
246+
externalJsonProps: false, // Disable if needed for custom tooling
247+
} satisfies OpenApiPlugin.Options,
248+
```
249+
225250
## Theme Configuration Options
226251

227252
The `docusaurus-theme-openapi-docs` theme can be configured with the following options in `themeConfig.api`:

demo/docs/intro.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ The `docusaurus-plugin-openapi-docs` plugin can be configured with the following
221221
| `versions` | `object` | `null` | _Optional:_ Options for versioning configuration. See below for a list of supported options. |
222222
| `markdownGenerators` | `object` | `null` | _Optional:_ Customize MDX content via generator functions. See below for a list of supported options. |
223223
| `showSchemas` | `boolean` | `null` | _Optional:_ If set to `true`, generates standalone schema pages and adds them to the sidebar. |
224+
| `showInfoPage` | `boolean` | `true` | _Optional:_ If set to `false`, disables generation of the info page (overview page with API title and description). |
225+
| `schemasOnly` | `boolean` | `false` | _Optional:_ If set to `true`, generates only schema pages (no API endpoint pages). Also available as `--schemas-only` CLI flag. |
226+
| `maskCredentials` | `boolean` | `true` | _Optional:_ If set to `false`, disables credential masking in generated code snippets. By default, credentials are masked for security. |
224227
| `externalJsonProps` | `boolean` | `true` | _Optional:_ If set to `false`, disables externalization of large JSON props. By default, large JSON is written to external files for better build performance. |
225228

226229
### sidebarOptions
@@ -286,6 +289,28 @@ petstore31: {
286289
| --------------- | ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
287290
| `createDocItem` | `function` | `null` | Optional: Returns a `SidebarItemDoc` object containing metadata for a sidebar item.<br/><br/>**Function type:** `(item: ApiPageMetadata \| SchemaPageMetadata, context: { sidebarOptions: SidebarOptions; basePath: string }) => SidebarItemDoc` |
288291

292+
### Performance Optimization
293+
294+
By default, `externalJsonProps` is enabled to optimize Docusaurus build times. This externalizes large JSON objects to separate files, significantly improving build performance for large OpenAPI specs.
295+
296+
**How it works:**
297+
298+
- With `externalJsonProps: true` (default): Large JSON props are written to separate `.json` files and loaded via `require()`. This bypasses MDX AST processing entirely, allowing the bundler to handle JSON more efficiently.
299+
300+
- With `externalJsonProps: false`: Large JSON objects (responses, request bodies, parameters) are embedded directly in the MDX. The MDX compiler must parse these into an AST and serialize them back, which can be slow for deeply nested schemas.
301+
302+
**When to disable:**
303+
304+
You may set `externalJsonProps: false` if you have custom tooling that depends on parsing the MDX files directly:
305+
306+
```typescript
307+
petstore: {
308+
specPath: "examples/petstore.yaml",
309+
outputDir: "docs/petstore",
310+
externalJsonProps: false, // Disable if needed for custom tooling
311+
} satisfies OpenApiPlugin.Options,
312+
```
313+
289314
## Theme Configuration Options
290315

291316
The `docusaurus-theme-openapi-docs` theme can be configured with the following options in `themeConfig.api`:

0 commit comments

Comments
 (0)