Skip to content

Commit 568f26c

Browse files
authored
docs: harmonize top-level README with plugin README (#1446)
Resolve drift uncovered during the v5.0.2 release scrub. Both READMEs and the demo intro page should describe the same plugin surface. - Top-level README: add the missing `Supported Vendor Extensions` section (table + ignored-extensions paragraph), the `x-position` hint under `sidebarOptions`, the `maskCredentials` example-config line, and the `Extensible` Key Feature bullet. Move the `maskCredentials` row up next to `showExtensions` so related rendering toggles sit together. - Plugin README: add the `Extensible` Key Feature bullet and linkify `@bourdakos1` to match the top-level README. `demo/docs/intro.mdx` already had this content and is unchanged.
1 parent 56c7bf2 commit 568f26c

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Key Features:
3636
- **Fast:** Convert large OpenAPI specs into MDX docs in seconds. 🔥
3737
- **Stylish:** Based on the same [Infima styling framework](https://infima.dev/) that powers the Docusaurus UI.
3838
- **Flexible:** Supports single, multi and _even micro_ OpenAPI specs.
39+
- **Extensible:** Recognizes common vendor extensions for customizing your docs. See [Supported Vendor Extensions](#supported-vendor-extensions) for details.
3940

4041
## Compatibility Matrix
4142

@@ -125,6 +126,7 @@ import type * as OpenApiPlugin from "docusaurus-plugin-openapi-docs";
125126
petstore: {
126127
specPath: "examples/petstore.yaml",
127128
outputDir: "docs/petstore",
129+
maskCredentials: false, // Disable credential masking in code snippets
128130
sidebarOptions: {
129131
groupPathsBy: "tag",
130132
},
@@ -165,6 +167,7 @@ The `docusaurus-plugin-openapi-docs` plugin can be configured with the following
165167
| `downloadUrl` | `string` | `null` | _Optional:_ Designated URL for downloading OpenAPI specification. (requires `info` section/doc) |
166168
| `hideSendButton` | `boolean` | `null` | _Optional:_ If set to `true`, hides the “Send API Request” button in the API demo panel. |
167169
| `showExtensions` | `boolean` | `null` | _Optional:_ If set to `true`, renders operation‑level vendor‑extensions in descriptions. |
170+
| `maskCredentials` | `boolean` | `true` | _Optional:_ If set to `false`, disables credential masking in generated code snippets. By default, credentials are masked for security. |
168171
| `sidebarOptions` | `object` | `null` | _Optional:_ Set of options for sidebar configuration. See below for a list of supported options. |
169172
| `version` | `string` | `null` | _Optional:_ Version assigned to a single or micro‑spec API specified in `specPath`. |
170173
| `label` | `string` | `null` | _Optional:_ Version label used when generating the version‑selector dropdown menu. |
@@ -174,7 +177,6 @@ The `docusaurus-plugin-openapi-docs` plugin can be configured with the following
174177
| `showSchemas` | `boolean` | `null` | _Optional:_ If set to `true`, generates standalone schema pages and adds them to the sidebar. |
175178
| `showInfoPage` | `boolean` | `true` | _Optional:_ If set to `false`, disables generation of the info page (overview page with API title and description). |
176179
| `schemasOnly` | `boolean` | `false` | _Optional:_ If set to `true`, generates only schema pages (no API endpoint pages). Also available as `--schemas-only` CLI flag. |
177-
| `maskCredentials` | `boolean` | `true` | _Optional:_ If set to `false`, disables credential masking in generated code snippets. By default, credentials are masked for security. |
178180
| `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. |
179181

180182
### sidebarOptions
@@ -191,6 +193,7 @@ The `docusaurus-plugin-openapi-docs` plugin can be configured with the following
191193
| `sidebarGenerators` | `object` | `null` | Optional: Customize sidebar rendering with callback functions. |
192194

193195
> You may optionally configure a `sidebarOptions`. In doing so, an individual `sidebar.js` slice with the configured options will be generated within the respective `outputDir`.
196+
> Use `x-position` vendor extension (or the front matter `position`) on operations to explicitly order sidebar items.
194197
195198
`versions` can be configured with the following options:
196199

@@ -272,6 +275,24 @@ Example:
272275
}
273276
```
274277

278+
## Supported Vendor Extensions
279+
280+
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.
281+
282+
| Extension | Purpose |
283+
| ------------------------------------------ | --------------------------------------------------------------------- |
284+
| `x-codeSamples` | Operation level code snippets displayed in the API Explorer. |
285+
| `x-tagGroups` | Groups tags in the sidebar navigation. |
286+
| `x-tags` | Assigns tags to schema objects so they appear with tagged operations. |
287+
| `x-position` | Controls ordering of items in the sidebar. |
288+
| `x-logo` / `x-dark-logo` | Provides logos for light and dark themes on the intro page. |
289+
| `x-deprecated-description` | Custom text shown for deprecated operations. |
290+
| `x-webhooks` | Defines webhook events. |
291+
| `x-displayName` | Overrides tag display names. |
292+
| `x-enumDescription` / `x-enumDescriptions` | Documents enum values. |
293+
294+
Other ReDoc specific extensions such as `x-circular-ref`, `x-code-samples` (deprecated), `x-examples`, `x-ignoredHeaderParameters`, `x-nullable`, `x-servers`, `x-traitTag`, `x-additionalPropertiesName`, and `x-explicitMappingOnly` are ignored when extracting custom data.
295+
275296
## CLI Usage
276297

277298
```bash

packages/docusaurus-plugin-openapi-docs/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Key Features:
3636
- **Fast:** Convert large OpenAPI specs into MDX docs in seconds. 🔥
3737
- **Stylish:** Based on the same [Infima styling framework](https://infima.dev/) that powers the Docusaurus UI.
3838
- **Flexible:** Supports single, multi and _even micro_ OpenAPI specs.
39+
- **Extensible:** Recognizes common vendor extensions for customizing your docs. See [Supported Vendor Extensions](#supported-vendor-extensions) for details.
3940

4041
## Compatibility Matrix
4142

@@ -437,7 +438,7 @@ yarn watch:demo
437438

438439
## Credits
439440

440-
Special thanks to @bourdakos1 (Nick Bourdakos), the author of [docusaurus-openapi](https://github.com/cloud-annotations/docusaurus-openapi), which this project is heavily based on.
441+
Special thanks to [@bourdakos1](https://github.com/bourdakos1) (Nick Bourdakos), the author of [docusaurus-openapi](https://github.com/cloud-annotations/docusaurus-openapi), which this project is heavily based on.
441442

442443
For more insight into why we decided to completely fork see [#47](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/47)
443444

0 commit comments

Comments
 (0)