@midwayjs/swagger 3.14.6 → 3.14.8

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.
@@ -11,6 +11,7 @@ export declare class DocumentBuilder {
11
11
  setExternalDoc(description: string, url: string): this;
12
12
  addPaths(paths: Record<string, PathItemObject>): this;
13
13
  getPaths(): PathsObject;
14
+ setPaths(paths: Record<string, PathItemObject>): this;
14
15
  addSchema(schema: Record<string, SchemaObject>): this;
15
16
  getSchema(name: string): SchemaObject;
16
17
  addTag(name: string, description?: string, externalDocs?: ExternalDocumentationObject): this;
@@ -56,6 +56,10 @@ class DocumentBuilder {
56
56
  getPaths() {
57
57
  return this.document.paths;
58
58
  }
59
+ setPaths(paths) {
60
+ this.document.paths = paths;
61
+ return this;
62
+ }
59
63
  addSchema(schema) {
60
64
  if (!this.document.components.schemas) {
61
65
  this.document.components.schemas = {};
@@ -80,7 +80,7 @@ let SwaggerExplorer = class SwaggerExplorer {
80
80
  newPaths[`${globalPrefix}${routerUrl}`] = value;
81
81
  }
82
82
  }
83
- this.documentBuilder.addPaths(newPaths);
83
+ this.documentBuilder.setPaths(newPaths);
84
84
  }
85
85
  scanApp() {
86
86
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/swagger",
3
- "version": "3.14.6",
3
+ "version": "3.14.8",
4
4
  "main": "dist/index.js",
5
5
  "typings": "index.d.ts",
6
6
  "files": [
@@ -11,9 +11,9 @@
11
11
  ],
12
12
  "devDependencies": {
13
13
  "@midwayjs/core": "^3.14.4",
14
- "@midwayjs/koa": "^3.14.4",
15
- "@midwayjs/mock": "^3.14.4",
16
- "@midwayjs/validate": "^3.14.4",
14
+ "@midwayjs/koa": "^3.14.7",
15
+ "@midwayjs/mock": "^3.14.7",
16
+ "@midwayjs/validate": "^3.14.7",
17
17
  "swagger-ui-dist": "4.19.1"
18
18
  },
19
19
  "author": "Kurten Chan <chinkurten@gmail.com>",
@@ -28,5 +28,5 @@
28
28
  "type": "git",
29
29
  "url": "https://github.com/midwayjs/midway.git"
30
30
  },
31
- "gitHead": "c33891e8bf4439fcf00fb6a0ac353b9b445312ce"
31
+ "gitHead": "38fc9025b81b1697c18e7efa1e2f4b635f04dd6d"
32
32
  }