docusaurus-plugin-openapi-docs 0.0.0-419 → 0.0.0-420
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/openapi/openapi.js
CHANGED
|
@@ -259,7 +259,7 @@ async function processOpenapiFiles(files, sidebarOptions) {
|
|
|
259
259
|
// Remove undefined tags due to transient parsing errors
|
|
260
260
|
return x !== undefined;
|
|
261
261
|
});
|
|
262
|
-
return [items, tags];
|
|
262
|
+
return [items, tags[0]];
|
|
263
263
|
}
|
|
264
264
|
exports.processOpenapiFiles = processOpenapiFiles;
|
|
265
265
|
async function processOpenapiFile(openapiData, sidebarOptions) {
|
package/lib/sidebars/index.js
CHANGED
|
@@ -33,9 +33,16 @@ function groupByTags(items, sidebarOptions, options, tags, docPath) {
|
|
|
33
33
|
};
|
|
34
34
|
});
|
|
35
35
|
// TODO: make sure we only take the first tag
|
|
36
|
-
const
|
|
36
|
+
const operationTags = (0, uniq_1.default)(apiItems
|
|
37
37
|
.flatMap((item) => item.api.tags)
|
|
38
38
|
.filter((item) => !!item));
|
|
39
|
+
const apiTags = [];
|
|
40
|
+
// eslint-disable-next-line array-callback-return
|
|
41
|
+
tags.map((tag) => {
|
|
42
|
+
if (operationTags.includes(tag.name)) {
|
|
43
|
+
apiTags.push(tag.name);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
39
46
|
const basePath = docPath
|
|
40
47
|
? outputDir.split(docPath)[1].replace(/^\/+/g, "")
|
|
41
48
|
: outputDir.slice(outputDir.indexOf("/", 1)).replace(/^\/+/g, "");
|
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-420",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"engines": {
|
|
68
68
|
"node": ">=14"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "d3a62f626be0bc127f6d9f3534a20e8a1ff84192"
|
|
71
71
|
}
|
package/src/openapi/openapi.ts
CHANGED
|
@@ -338,7 +338,7 @@ export async function processOpenapiFiles(
|
|
|
338
338
|
// Remove undefined tags due to transient parsing errors
|
|
339
339
|
return x !== undefined;
|
|
340
340
|
});
|
|
341
|
-
return [items as ApiMetadata[], tags as TagObject[]];
|
|
341
|
+
return [items as ApiMetadata[], tags[0] as TagObject[]];
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
export async function processOpenapiFile(
|
package/src/sidebars/index.ts
CHANGED
|
@@ -60,11 +60,18 @@ function groupByTags(
|
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
// TODO: make sure we only take the first tag
|
|
63
|
-
const
|
|
63
|
+
const operationTags = uniq(
|
|
64
64
|
apiItems
|
|
65
65
|
.flatMap((item) => item.api.tags)
|
|
66
66
|
.filter((item): item is string => !!item)
|
|
67
67
|
);
|
|
68
|
+
const apiTags: string[] = [];
|
|
69
|
+
// eslint-disable-next-line array-callback-return
|
|
70
|
+
tags.map((tag) => {
|
|
71
|
+
if (operationTags.includes(tag.name!)) {
|
|
72
|
+
apiTags.push(tag.name!);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
68
75
|
|
|
69
76
|
const basePath = docPath
|
|
70
77
|
? outputDir.split(docPath!)[1].replace(/^\/+/g, "")
|