docusaurus-plugin-openapi-docs 1.1.1 → 1.1.2

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.
@@ -40,7 +40,8 @@ function jsonToCollection(data) {
40
40
  */
41
41
  async function createPostmanCollection(openapiData) {
42
42
  var _a, _b, _c, _d, _e, _f, _g, _h;
43
- const data = openapiData;
43
+ // Create copy of openapiData
44
+ const data = Object.assign({}, openapiData);
44
45
  // Including `servers` breaks postman, so delete all of them.
45
46
  delete data.servers;
46
47
  for (let pathItemObject of Object.values(data.paths)) {
@@ -114,7 +115,9 @@ function createItems(openapiData, sidebarOptions) {
114
115
  operationObject.description =
115
116
  (_h = (_g = operationObject.summary) !== null && _g !== void 0 ? _g : operationObject.operationId) !== null && _h !== void 0 ? _h : "";
116
117
  }
117
- const baseId = (0, lodash_1.kebabCase)(title);
118
+ const baseId = operationObject.operationId
119
+ ? (0, lodash_1.kebabCase)(operationObject.operationId)
120
+ : (0, lodash_1.kebabCase)(operationObject.summary);
118
121
  const servers = (_k = (_j = operationObject.servers) !== null && _j !== void 0 ? _j : pathObject.servers) !== null && _k !== void 0 ? _k : openapiData.servers;
119
122
  const security = (_l = operationObject.security) !== null && _l !== void 0 ? _l : openapiData.security;
120
123
  // Add security schemes so we know how to handle security.
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": "1.1.1",
4
+ "version": "1.1.2",
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": "3eb4608e07c5e4f01328fea4e488e9e0f90134a8"
70
+ "gitHead": "0c66efff6ff553647265abdc27d4ca847c6d8045"
71
71
  }
@@ -53,7 +53,8 @@ function jsonToCollection(data: OpenApiObject): Promise<Collection> {
53
53
  async function createPostmanCollection(
54
54
  openapiData: OpenApiObject
55
55
  ): Promise<Collection> {
56
- const data = openapiData as OpenApiObject;
56
+ // Create copy of openapiData
57
+ const data = Object.assign({}, openapiData) as OpenApiObject;
57
58
 
58
59
  // Including `servers` breaks postman, so delete all of them.
59
60
  delete data.servers;
@@ -146,7 +147,9 @@ function createItems(
146
147
  operationObject.summary ?? operationObject.operationId ?? "";
147
148
  }
148
149
 
149
- const baseId = kebabCase(title);
150
+ const baseId = operationObject.operationId
151
+ ? kebabCase(operationObject.operationId)
152
+ : kebabCase(operationObject.summary);
150
153
 
151
154
  const servers =
152
155
  operationObject.servers ?? pathObject.servers ?? openapiData.servers;