You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds documentation for the new schemaExpansion theme option (introduced
in #1449) to intro.mdx and both READMEs, covering the nested enabled,
default, max, and persist fields plus an example config.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|`proxy`|`string`|`null`|_Optional:_ Site-wide proxy URL to prepend to base URL when performing API requests. Can be overridden per-spec via plugin config. |
258
-
|`authPersistance`|`string`|`null`|_Optional:_ Determines how auth credentials are persisted. Options: `"localStorage"`, `"sessionStorage"`, or `false` to disable. |
259
-
|`requestTimeout`|`number`|`30000`|_Optional:_ Request timeout in milliseconds for API requests made from the browser. Defaults to 30 seconds. |
260
-
|`requestCredentials`|`string`|`"same-origin"`|_Optional:_ Controls cookie behavior for API requests. Options: `"omit"`, `"same-origin"`, or `"include"`. |
|`proxy`|`string`|`null`|_Optional:_ Site-wide proxy URL to prepend to base URL when performing API requests. Can be overridden per-spec via plugin config. |
258
+
|`authPersistance`|`string`|`null`|_Optional:_ Determines how auth credentials are persisted. Options: `"localStorage"`, `"sessionStorage"`, or `false` to disable. |
259
+
|`requestTimeout`|`number`|`30000`|_Optional:_ Request timeout in milliseconds for API requests made from the browser. Defaults to 30 seconds. |
260
+
|`requestCredentials`|`string`|`"same-origin"`|_Optional:_ Controls cookie behavior for API requests. Options: `"omit"`, `"same-origin"`, or `"include"`. |
261
+
|`schemaExpansion`|`object`|`null`|_Optional:_ Controls the default expansion depth of nested request/response schema trees and (optionally) renders an inline depth control. See [`schemaExpansion`](#schemaexpansion) below. |
261
262
262
263
Example:
263
264
@@ -270,11 +271,29 @@ Example:
270
271
authPersistance: "localStorage",
271
272
requestTimeout: 60000, // 60 seconds
272
273
requestCredentials: "omit", // Prevent cookies from being sent with requests
274
+
schemaExpansion: {
275
+
enabled: true, // render the inline depth control next to each schema header
276
+
default: 1, // auto-expand the first level on page load
277
+
max: 4, // highest numeric depth offered by the control
278
+
},
273
279
},
274
280
},
275
281
}
276
282
```
277
283
284
+
### schemaExpansion
285
+
286
+
Inspired by Redoc's `schemaExpansionLevel`, `schemaExpansion` configures how deeply nested schema trees auto-expand and whether readers can change the depth at view time.
|`enabled`|`boolean`|`false`| Render an interactive depth control next to each schema header so readers can change the expansion depth at view time. |
291
+
|`default`|`number \| "all"`|`0`| Initial expansion depth applied on every page load. Use `"all"` to expand everything. Applies whether or not `enabled` is `true`. |
292
+
|`max`|`number`|`4`| Highest numeric depth offered by the UI control. Ignored when `enabled` is `false`. |
293
+
|`persist`|`boolean`|`true`| Persist the reader's selected depth in `localStorage`. Only meaningful when `enabled` is `true`; persistence is implicitly off when the control is hidden. |
294
+
295
+
You can set just `{ default: 1 }` to auto-expand the first level on every page load without rendering the depth control. When `schemaExpansion` is unset entirely, behavior is unchanged from prior releases (all schemas collapsed by default).
296
+
278
297
## Supported Vendor Extensions
279
298
280
299
The plugin extracts a number of vendor extensions from the OpenAPI spec to enrich the generated docs. The theme renders some of these values as part of the UI.
Copy file name to clipboardExpand all lines: demo/docs/intro.mdx
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -319,6 +319,7 @@ The `docusaurus-theme-openapi-docs` theme can be configured with the following o
319
319
|`authPersistance`|`string`|`null`|_Optional:_ Determines how auth credentials are persisted. Options: `"localStorage"`, `"sessionStorage"`, or `false` to disable. |
320
320
|`requestTimeout`|`number`|`30000`|_Optional:_ Request timeout in milliseconds for API requests made from the browser. Defaults to 30 seconds. |
321
321
|`requestCredentials`|`string`|`"same-origin"`|_Optional:_ Controls cookie behavior for API requests. Options: `"omit"`, `"same-origin"`, or `"include"`. |
322
+
|`schemaExpansion`|`object`|`null`|_Optional:_ Controls the default expansion depth of nested request/response schema trees and (optionally) renders an inline depth control. See [`schemaExpansion`](#schemaexpansion) below. |
322
323
323
324
Example:
324
325
@@ -331,11 +332,29 @@ Example:
331
332
authPersistance: "localStorage",
332
333
requestTimeout: 60000, // 60 seconds
333
334
requestCredentials: "omit", // Prevent cookies from being sent with requests
335
+
schemaExpansion: {
336
+
enabled: true, // render the inline depth control next to each schema header
337
+
default: 1, // auto-expand the first level on page load
338
+
max: 4, // highest numeric depth offered by the control
339
+
},
334
340
},
335
341
},
336
342
}
337
343
```
338
344
345
+
### schemaExpansion
346
+
347
+
Inspired by Redoc's `schemaExpansionLevel`, `schemaExpansion` configures how deeply nested schema trees auto-expand and whether readers can change the depth at view time.
|`enabled`|`boolean`|`false`| Render an interactive depth control next to each schema header so readers can change the expansion depth at view time. |
352
+
|`default`|`number \| "all"`|`0`| Initial expansion depth applied on every page load. Use `"all"` to expand everything. Applies whether or not `enabled` is `true`. |
353
+
|`max`|`number`|`4`| Highest numeric depth offered by the UI control. Ignored when `enabled` is `false`. |
354
+
|`persist`|`boolean`|`true`| Persist the reader's selected depth in `localStorage`. Only meaningful when `enabled` is `true`; persistence is implicitly off when the control is hidden. |
355
+
356
+
You can set just `{ default: 1 }` to auto-expand the first level on every page load without rendering the depth control. When `schemaExpansion` is unset entirely, behavior is unchanged from prior releases (all schemas collapsed by default).
357
+
339
358
## CLI Usage
340
359
341
360
After you've installed and configured the plugin and theme, the CLI can be used to `generate` and `clean` API docs.
|`proxy`|`string`|`null`|_Optional:_ Site-wide proxy URL to prepend to base URL when performing API requests. Can be overridden per-spec via plugin config. |
258
-
|`authPersistance`|`string`|`null`|_Optional:_ Determines how auth credentials are persisted. Options: `"localStorage"`, `"sessionStorage"`, or `false` to disable. |
259
-
|`requestTimeout`|`number`|`30000`|_Optional:_ Request timeout in milliseconds for API requests made from the browser. Defaults to 30 seconds. |
260
-
|`requestCredentials`|`string`|`"same-origin"`|_Optional:_ Controls cookie behavior for API requests. Options: `"omit"`, `"same-origin"`, or `"include"`. |
|`proxy`|`string`|`null`|_Optional:_ Site-wide proxy URL to prepend to base URL when performing API requests. Can be overridden per-spec via plugin config. |
258
+
|`authPersistance`|`string`|`null`|_Optional:_ Determines how auth credentials are persisted. Options: `"localStorage"`, `"sessionStorage"`, or `false` to disable. |
259
+
|`requestTimeout`|`number`|`30000`|_Optional:_ Request timeout in milliseconds for API requests made from the browser. Defaults to 30 seconds. |
260
+
|`requestCredentials`|`string`|`"same-origin"`|_Optional:_ Controls cookie behavior for API requests. Options: `"omit"`, `"same-origin"`, or `"include"`. |
261
+
|`schemaExpansion`|`object`|`null`|_Optional:_ Controls the default expansion depth of nested request/response schema trees and (optionally) renders an inline depth control. See [`schemaExpansion`](#schemaexpansion) below. |
261
262
262
263
Example:
263
264
@@ -270,11 +271,29 @@ Example:
270
271
authPersistance: "localStorage",
271
272
requestTimeout: 60000, // 60 seconds
272
273
requestCredentials: "omit", // Prevent cookies from being sent with requests
274
+
schemaExpansion: {
275
+
enabled: true, // render the inline depth control next to each schema header
276
+
default: 1, // auto-expand the first level on page load
277
+
max: 4, // highest numeric depth offered by the control
278
+
},
273
279
},
274
280
},
275
281
}
276
282
```
277
283
284
+
### schemaExpansion
285
+
286
+
Inspired by Redoc's `schemaExpansionLevel`, `schemaExpansion` configures how deeply nested schema trees auto-expand and whether readers can change the depth at view time.
|`enabled`|`boolean`|`false`| Render an interactive depth control next to each schema header so readers can change the expansion depth at view time. |
291
+
|`default`|`number \| "all"`|`0`| Initial expansion depth applied on every page load. Use `"all"` to expand everything. Applies whether or not `enabled` is `true`. |
292
+
|`max`|`number`|`4`| Highest numeric depth offered by the UI control. Ignored when `enabled` is `false`. |
293
+
|`persist`|`boolean`|`true`| Persist the reader's selected depth in `localStorage`. Only meaningful when `enabled` is `true`; persistence is implicitly off when the control is hidden. |
294
+
295
+
You can set just `{ default: 1 }` to auto-expand the first level on every page load without rendering the depth control. When `schemaExpansion` is unset entirely, behavior is unchanged from prior releases (all schemas collapsed by default).
296
+
278
297
## Supported Vendor Extensions
279
298
280
299
The plugin extracts a number of vendor extensions from the OpenAPI spec to enrich the generated docs. The theme renders some of these values as part of the UI.
0 commit comments