docusaurus-plugin-openapi-docs 0.0.0-461 → 0.0.0-462
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/lib/index.js +4 -0
- package/package.json +2 -2
- package/src/index.ts +6 -0
package/lib/index.js
CHANGED
|
@@ -196,6 +196,10 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
|
|
|
196
196
|
if (item.type === "api") {
|
|
197
197
|
if (!fs_1.default.existsSync(`${outputDir}/${item.id}.api.mdx`)) {
|
|
198
198
|
try {
|
|
199
|
+
// kebabCase(arg) returns 0-length string when arg is undefined
|
|
200
|
+
if (item.id.length === 0) {
|
|
201
|
+
throw Error("Operation must have summary or operationId defined");
|
|
202
|
+
}
|
|
199
203
|
fs_1.default.writeFileSync(`${outputDir}/${item.id}.api.mdx`, view, "utf8");
|
|
200
204
|
console.log(chalk_1.default.green(`Successfully created "${outputDir}/${item.id}.api.mdx"`));
|
|
201
205
|
}
|
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-462",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"engines": {
|
|
69
69
|
"node": ">=14"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "cb520190f1ac4b8dc0d9ce7b1f3732c3ebc5c054"
|
|
72
72
|
}
|
package/src/index.ts
CHANGED
|
@@ -235,6 +235,12 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
|
|
|
235
235
|
if (item.type === "api") {
|
|
236
236
|
if (!fs.existsSync(`${outputDir}/${item.id}.api.mdx`)) {
|
|
237
237
|
try {
|
|
238
|
+
// kebabCase(arg) returns 0-length string when arg is undefined
|
|
239
|
+
if (item.id.length === 0) {
|
|
240
|
+
throw Error(
|
|
241
|
+
"Operation must have summary or operationId defined"
|
|
242
|
+
);
|
|
243
|
+
}
|
|
238
244
|
fs.writeFileSync(`${outputDir}/${item.id}.api.mdx`, view, "utf8");
|
|
239
245
|
console.log(
|
|
240
246
|
chalk.green(
|