docusaurus-plugin-openapi-docs 0.0.0-399 → 0.0.0-404

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 CHANGED
@@ -246,7 +246,7 @@ yarn docusaurus gen-api-docs:version petstore:all
246
246
  Run the following to bootstrap a Docsaurus v2 site (classic theme) with `docusaurus-openapi-docs`:
247
247
 
248
248
  ```bash
249
- npx create-docusaurus@2.0.0-beta.21 my-website --package-manager yarn
249
+ npx create-docusaurus@2.0.0-rc.1 my-website --package-manager yarn
250
250
  ```
251
251
 
252
252
  > When prompted to select a template choose `Git repository`.
@@ -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": "0.0.0-399",
4
+ "version": "0.0.0-404",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -28,8 +28,8 @@
28
28
  "watch": "tsc --watch"
29
29
  },
30
30
  "devDependencies": {
31
- "@docusaurus/module-type-aliases": "2.0.0-beta.22",
32
- "@docusaurus/types": "2.0.0-beta.22",
31
+ "@docusaurus/module-type-aliases": "2.0.0-rc.1",
32
+ "@docusaurus/types": "2.0.0-rc.1",
33
33
  "@types/fs-extra": "^9.0.13",
34
34
  "@types/js-yaml": "^4.0.5",
35
35
  "@types/json-pointer": "^1.0.31",
@@ -40,10 +40,10 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@apidevtools/json-schema-ref-parser": "^9.0.9",
43
- "@docusaurus/mdx-loader": "2.0.0-beta.22",
44
- "@docusaurus/plugin-content-docs": "2.0.0-beta.22",
45
- "@docusaurus/utils": "2.0.0-beta.22",
46
- "@docusaurus/utils-validation": "2.0.0-beta.22",
43
+ "@docusaurus/mdx-loader": "2.0.0-rc.1",
44
+ "@docusaurus/plugin-content-docs": "2.0.0-rc.1",
45
+ "@docusaurus/utils": "2.0.0-rc.1",
46
+ "@docusaurus/utils-validation": "2.0.0-rc.1",
47
47
  "@paloaltonetworks/openapi-to-postmanv2": "3.1.0-hotfix.1",
48
48
  "@paloaltonetworks/postman-collection": "^4.1.0",
49
49
  "@redocly/openapi-core": "^1.0.0-beta.103",
@@ -67,5 +67,5 @@
67
67
  "engines": {
68
68
  "node": ">=14"
69
69
  },
70
- "gitHead": "b42f88176b921b8871b87b95c08e5444e17b76b9"
70
+ "gitHead": "5db669de6eec48232dd389255c44c675fe9410fd"
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;