docusaurus-plugin-openapi-docs 0.0.0-1073 → 0.0.0-1075
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -20
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -156,26 +156,26 @@ The `docusaurus-plugin-openapi-docs` plugin can be configured with the following
|
|
|
156
156
|
|
|
157
157
|
`config` can be configured with the following options:
|
|
158
158
|
|
|
159
|
-
| Name | Type | Default | Description
|
|
160
|
-
| -------------------- | --------- | ------- |
|
|
161
|
-
| `specPath` | `string` | `null` | Designated URL or path to the source of an OpenAPI specification file or directory of multiple OpenAPI specification files.
|
|
162
|
-
| `outputDir` | `string` | `null` | Desired output path for generated MDX and sidebar files.
|
|
163
|
-
| `proxy` | `string` | `null` | _Optional:_ Proxy URL to prepend to base URL when performing API requests from browser.
|
|
164
|
-
| `template` | `string` | `null` | _Optional:_ Customize MDX content with a desired template.
|
|
165
|
-
| `infoTemplate` | `string` | `null` | _Optional:_ Customize MDX content for **info** pages only.
|
|
166
|
-
| `tagTemplate` | `string` | `null` | _Optional:_ Customize MDX content for **tag** pages only.
|
|
167
|
-
| `schemaTemplate` | `string` | `null` | _Optional:_ Customize MDX content for **schema** pages only.
|
|
168
|
-
| `downloadUrl` | `string` | `null` | _Optional:_ Designated URL for downloading OpenAPI specification. (requires `info` section/doc)
|
|
169
|
-
| `hideSendButton` | `boolean` | `null` | _Optional:_ If set to `true`, hides the “Send API Request” button in the API demo panel.
|
|
170
|
-
| `showExtensions` | `boolean` | `null` | _Optional:_ If set to `true`, renders operation‑level vendor‑extensions in descriptions.
|
|
171
|
-
| `maskCredentials` | `boolean` | `true` | _Optional:_ If set to `false`, disables credential masking in generated code snippets. By default, credentials are masked for security.
|
|
172
|
-
| `sidebarOptions` | `object` | `null` | _Optional:_ Set of options for sidebar configuration. See below for a list of supported options.
|
|
173
|
-
| `version` | `string` | `null` | _Optional:_ Version assigned to a single or micro‑spec API specified in `specPath`.
|
|
174
|
-
| `label` | `string` | `null` | _Optional:_ Version label used when generating the version‑selector dropdown menu.
|
|
175
|
-
| `baseUrl` | `string` | `null` | _Optional:_ Base URL for versioned docs in the version‑selector dropdown.
|
|
176
|
-
| `versions` | `object` | `null` | _Optional:_ Options for versioning configuration. See below for a list of supported options.
|
|
177
|
-
| `markdownGenerators` | `object` | `null` | _Optional:_ Customize MDX content via generator functions. See below for a list of supported options.
|
|
178
|
-
| `showSchemas` | `boolean` | `null` | _Optional:_ If set to `true`, generates standalone schema pages and adds them to the sidebar.
|
|
159
|
+
| Name | Type | Default | Description |
|
|
160
|
+
| -------------------- | --------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
161
|
+
| `specPath` | `string` | `null` | Designated URL or path to the source of an OpenAPI specification file or directory of multiple OpenAPI specification files. |
|
|
162
|
+
| `outputDir` | `string` | `null` | Desired output path for generated MDX and sidebar files. |
|
|
163
|
+
| `proxy` | `string` | `null` | _Optional:_ Proxy URL to prepend to base URL when performing API requests from browser. Overrides site-wide `themeConfig.api.proxy` if set. |
|
|
164
|
+
| `template` | `string` | `null` | _Optional:_ Customize MDX content with a desired template. |
|
|
165
|
+
| `infoTemplate` | `string` | `null` | _Optional:_ Customize MDX content for **info** pages only. |
|
|
166
|
+
| `tagTemplate` | `string` | `null` | _Optional:_ Customize MDX content for **tag** pages only. |
|
|
167
|
+
| `schemaTemplate` | `string` | `null` | _Optional:_ Customize MDX content for **schema** pages only. |
|
|
168
|
+
| `downloadUrl` | `string` | `null` | _Optional:_ Designated URL for downloading OpenAPI specification. (requires `info` section/doc) |
|
|
169
|
+
| `hideSendButton` | `boolean` | `null` | _Optional:_ If set to `true`, hides the “Send API Request” button in the API demo panel. |
|
|
170
|
+
| `showExtensions` | `boolean` | `null` | _Optional:_ If set to `true`, renders operation‑level vendor‑extensions in descriptions. |
|
|
171
|
+
| `maskCredentials` | `boolean` | `true` | _Optional:_ If set to `false`, disables credential masking in generated code snippets. By default, credentials are masked for security. |
|
|
172
|
+
| `sidebarOptions` | `object` | `null` | _Optional:_ Set of options for sidebar configuration. See below for a list of supported options. |
|
|
173
|
+
| `version` | `string` | `null` | _Optional:_ Version assigned to a single or micro‑spec API specified in `specPath`. |
|
|
174
|
+
| `label` | `string` | `null` | _Optional:_ Version label used when generating the version‑selector dropdown menu. |
|
|
175
|
+
| `baseUrl` | `string` | `null` | _Optional:_ Base URL for versioned docs in the version‑selector dropdown. |
|
|
176
|
+
| `versions` | `object` | `null` | _Optional:_ Options for versioning configuration. See below for a list of supported options. |
|
|
177
|
+
| `markdownGenerators` | `object` | `null` | _Optional:_ Customize MDX content via generator functions. See below for a list of supported options. |
|
|
178
|
+
| `showSchemas` | `boolean` | `null` | _Optional:_ If set to `true`, generates standalone schema pages and adds them to the sidebar. |
|
|
179
179
|
|
|
180
180
|
### sidebarOptions
|
|
181
181
|
|
|
@@ -224,6 +224,31 @@ The `docusaurus-plugin-openapi-docs` plugin can be configured with the following
|
|
|
224
224
|
| --------------- | ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
225
225
|
| `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` |
|
|
226
226
|
|
|
227
|
+
## Theme Configuration Options
|
|
228
|
+
|
|
229
|
+
The `docusaurus-theme-openapi-docs` theme can be configured with the following options in `themeConfig.api`:
|
|
230
|
+
|
|
231
|
+
| Name | Type | Default | Description |
|
|
232
|
+
| ----------------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
233
|
+
| `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. |
|
|
234
|
+
| `authPersistance` | `string` | `null` | _Optional:_ Determines how auth credentials are persisted. Options: `"localStorage"`, `"sessionStorage"`, or `false` to disable. |
|
|
235
|
+
| `requestTimeout` | `number` | `30000` | _Optional:_ Request timeout in milliseconds for API requests made from the browser. Defaults to 30 seconds. |
|
|
236
|
+
|
|
237
|
+
Example:
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
// docusaurus.config.ts
|
|
241
|
+
{
|
|
242
|
+
themeConfig: {
|
|
243
|
+
api: {
|
|
244
|
+
proxy: "https://cors.pan.dev", // Site-wide proxy (can be overridden per-spec in plugin config)
|
|
245
|
+
authPersistance: "localStorage",
|
|
246
|
+
requestTimeout: 60000, // 60 seconds
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
227
252
|
## Supported Vendor Extensions
|
|
228
253
|
|
|
229
254
|
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.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-plugin-openapi-docs",
|
|
3
3
|
"description": "OpenAPI plugin for Docusaurus.",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-1075",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"engines": {
|
|
66
66
|
"node": ">=14"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "d4ec26e753c5bab96246a39a07b4ccd5a5ae8344"
|
|
69
69
|
}
|