docusaurus-plugin-openapi-docs 0.0.0-1082 → 0.0.0-1084
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 +2 -0
- package/lib/openapi/openapi.js +3 -2
- package/lib/options.js +2 -0
- package/lib/types.d.ts +1 -0
- package/package.json +2 -2
- package/src/openapi/openapi.ts +5 -2
- package/src/options.ts +2 -0
- package/src/types.ts +1 -0
package/README.md
CHANGED
|
@@ -176,6 +176,8 @@ The `docusaurus-plugin-openapi-docs` plugin can be configured with the following
|
|
|
176
176
|
| `versions` | `object` | `null` | _Optional:_ Options for versioning configuration. See below for a list of supported options. |
|
|
177
177
|
| `markdownGenerators` | `object` | `null` | _Optional:_ Customize MDX content via generator functions. See below for a list of supported options. |
|
|
178
178
|
| `showSchemas` | `boolean` | `null` | _Optional:_ If set to `true`, generates standalone schema pages and adds them to the sidebar. |
|
|
179
|
+
| `showInfoPage` | `boolean` | `true` | _Optional:_ If set to `false`, disables generation of the info page (overview page with API title and description). |
|
|
180
|
+
| `schemasOnly` | `boolean` | `false` | _Optional:_ If set to `true`, generates only schema pages (no API endpoint pages). Also available as `--schemas-only` CLI flag. |
|
|
179
181
|
|
|
180
182
|
### sidebarOptions
|
|
181
183
|
|
package/lib/openapi/openapi.js
CHANGED
|
@@ -109,8 +109,9 @@ function createItems(openapiData, options, sidebarOptions) {
|
|
|
109
109
|
const infoIdSpaces = openapiData.info.title.replace(" ", "-").toLowerCase();
|
|
110
110
|
const infoId = (0, kebabCase_1.default)(infoIdSpaces);
|
|
111
111
|
const schemasOnly = (options === null || options === void 0 ? void 0 : options.schemasOnly) === true;
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
// Only create an info page if we have a description/title AND showInfoPage is not false
|
|
113
|
+
if ((openapiData.info.description || openapiData.info.title) &&
|
|
114
|
+
(options === null || options === void 0 ? void 0 : options.showInfoPage) !== false) {
|
|
114
115
|
const infoDescription = (_a = openapiData.info) === null || _a === void 0 ? void 0 : _a.description;
|
|
115
116
|
let splitDescription;
|
|
116
117
|
if (infoDescription) {
|
package/lib/options.js
CHANGED
|
@@ -44,6 +44,8 @@ exports.OptionsSchema = utils_validation_1.Joi.object({
|
|
|
44
44
|
sidebarOptions: sidebarOptions,
|
|
45
45
|
markdownGenerators: markdownGenerators,
|
|
46
46
|
showSchemas: utils_validation_1.Joi.boolean(),
|
|
47
|
+
showInfoPage: utils_validation_1.Joi.boolean(),
|
|
48
|
+
schemasOnly: utils_validation_1.Joi.boolean(),
|
|
47
49
|
disableCompression: utils_validation_1.Joi.boolean(),
|
|
48
50
|
maskCredentials: utils_validation_1.Joi.boolean(),
|
|
49
51
|
version: utils_validation_1.Joi.string().when("versions", {
|
package/lib/types.d.ts
CHANGED
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-1084",
|
|
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": "0f4596a4e9c32f3d0e79cb45eac01958bbb11e9d"
|
|
69
69
|
}
|
package/src/openapi/openapi.ts
CHANGED
|
@@ -97,8 +97,11 @@ function createItems(
|
|
|
97
97
|
const infoId = kebabCase(infoIdSpaces);
|
|
98
98
|
const schemasOnly = options?.schemasOnly === true;
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
// Only create an info page if we have a description/title AND showInfoPage is not false
|
|
101
|
+
if (
|
|
102
|
+
(openapiData.info.description || openapiData.info.title) &&
|
|
103
|
+
options?.showInfoPage !== false
|
|
104
|
+
) {
|
|
102
105
|
const infoDescription = openapiData.info?.description;
|
|
103
106
|
let splitDescription: any;
|
|
104
107
|
if (infoDescription) {
|
package/src/options.ts
CHANGED
|
@@ -48,6 +48,8 @@ export const OptionsSchema = Joi.object({
|
|
|
48
48
|
sidebarOptions: sidebarOptions,
|
|
49
49
|
markdownGenerators: markdownGenerators,
|
|
50
50
|
showSchemas: Joi.boolean(),
|
|
51
|
+
showInfoPage: Joi.boolean(),
|
|
52
|
+
schemasOnly: Joi.boolean(),
|
|
51
53
|
disableCompression: Joi.boolean(),
|
|
52
54
|
maskCredentials: Joi.boolean(),
|
|
53
55
|
version: Joi.string().when("versions", {
|
package/src/types.ts
CHANGED