docusaurus-plugin-openapi-docs 0.0.0-407 → 0.0.0-408

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.
@@ -79,7 +79,6 @@ function createItems(openapiData, sidebarOptions) {
79
79
  unversionedId: tagId,
80
80
  title: description !== null && description !== void 0 ? description : "",
81
81
  description: description !== null && description !== void 0 ? description : "",
82
- slug: "/" + tagId,
83
82
  frontMatter: {},
84
83
  tag: {
85
84
  ...tag,
@@ -96,7 +95,6 @@ function createItems(openapiData, sidebarOptions) {
96
95
  unversionedId: infoId,
97
96
  title: openapiData.info.title,
98
97
  description: openapiData.info.description,
99
- slug: "/" + infoId,
100
98
  frontMatter: {},
101
99
  securitySchemes: (_b = openapiData.components) === null || _b === void 0 ? void 0 : _b.securitySchemes,
102
100
  info: {
@@ -144,7 +142,6 @@ function createItems(openapiData, sidebarOptions) {
144
142
  unversionedId: baseId,
145
143
  title: title,
146
144
  description: description !== null && description !== void 0 ? description : "",
147
- slug: "/" + baseId,
148
145
  frontMatter: {},
149
146
  api: {
150
147
  ...defaults,
@@ -9,6 +9,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ const path_1 = __importDefault(require("path"));
12
13
  const clsx_1 = __importDefault(require("clsx"));
13
14
  const lodash_1 = require("lodash");
14
15
  const uniq_1 = __importDefault(require("lodash/uniq"));
@@ -98,8 +99,8 @@ function groupByTags(items, sidebarOptions, options, tags, docPath) {
98
99
  type: "generated-index",
99
100
  title: tag,
100
101
  slug: label
101
- ? "/category/" + (0, lodash_1.kebabCase)(label) + "/" + (0, lodash_1.kebabCase)(tag)
102
- : "/category/" + (0, lodash_1.kebabCase)(tag),
102
+ ? path_1.default.join("/category", basePath, (0, lodash_1.kebabCase)(label), (0, lodash_1.kebabCase)(tag))
103
+ : path_1.default.join("/category", basePath, (0, lodash_1.kebabCase)(tag)),
103
104
  };
104
105
  }
105
106
  return {
package/lib/types.d.ts CHANGED
@@ -51,7 +51,7 @@ export interface ApiMetadataBase {
51
51
  description: string;
52
52
  source: string;
53
53
  sourceDirName: string;
54
- slug: string;
54
+ slug?: string;
55
55
  permalink: string;
56
56
  sidebarPosition?: number;
57
57
  frontMatter: Record<string, unknown>;
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-407",
4
+ "version": "0.0.0-408",
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": "8dd2c3d99a5d48f98a5b37aeb3451f68d66ebac0"
70
+ "gitHead": "a13982ebd24d40f4a81ba75a7f1046682b2ba49b"
71
71
  }
@@ -102,7 +102,6 @@ function createItems(
102
102
  unversionedId: tagId,
103
103
  title: description ?? "",
104
104
  description: description ?? "",
105
- slug: "/" + tagId,
106
105
  frontMatter: {},
107
106
  tag: {
108
107
  ...tag,
@@ -120,7 +119,6 @@ function createItems(
120
119
  unversionedId: infoId,
121
120
  title: openapiData.info.title,
122
121
  description: openapiData.info.description,
123
- slug: "/" + infoId,
124
122
  frontMatter: {},
125
123
  securitySchemes: openapiData.components?.securitySchemes,
126
124
  info: {
@@ -184,7 +182,6 @@ function createItems(
184
182
  unversionedId: baseId,
185
183
  title: title,
186
184
  description: description ?? "",
187
- slug: "/" + baseId,
188
185
  frontMatter: {},
189
186
  api: {
190
187
  ...defaults,
@@ -5,6 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  * ========================================================================== */
7
7
 
8
+ import path from "path";
9
+
8
10
  import {
9
11
  ProcessedSidebar,
10
12
  SidebarItemCategory,
@@ -139,8 +141,8 @@ function groupByTags(
139
141
  type: "generated-index" as "generated-index",
140
142
  title: tag,
141
143
  slug: label
142
- ? "/category/" + kebabCase(label) + "/" + kebabCase(tag)
143
- : "/category/" + kebabCase(tag),
144
+ ? path.join("/category", basePath, kebabCase(label), kebabCase(tag))
145
+ : path.join("/category", basePath, kebabCase(tag)),
144
146
  } as SidebarItemCategoryLinkConfig;
145
147
  }
146
148
 
package/src/types.ts CHANGED
@@ -76,7 +76,7 @@ export interface ApiMetadataBase {
76
76
  description: string;
77
77
  source: string; // @site aliased source => "@site/docs/folder/subFolder/subSubFolder/myDoc.md"
78
78
  sourceDirName: string; // relative to the versioned docs folder (can be ".") => "folder/subFolder/subSubFolder"
79
- slug: string;
79
+ slug?: string;
80
80
  permalink: string;
81
81
  sidebarPosition?: number;
82
82
  frontMatter: Record<string, unknown>;