@midwayjs/swagger 3.1.6 → 3.2.1

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.
@@ -32,7 +32,7 @@ function getTypeIsArrayTuple(input, isArrayFlag) {
32
32
  exports.getTypeIsArrayTuple = getTypeIsArrayTuple;
33
33
  function getSchemaPath(clzz) {
34
34
  let str = clzz;
35
- if (typeof clzz === 'object') {
35
+ if (typeof clzz !== 'string') {
36
36
  str = clzz ? clzz.name : clzz;
37
37
  }
38
38
  return `#/components/schemas/${str}`;
@@ -42,7 +42,8 @@ let SwaggerMiddleware = class SwaggerMiddleware {
42
42
  let content = (0, fs_1.readFileSync)((0, path_1.join)(this.swaggerUiAssetPath, lastName), {
43
43
  encoding: 'utf-8',
44
44
  });
45
- if (lastName === 'index.html') {
45
+ if (lastName === 'index.html' ||
46
+ lastName === 'swagger-initializer.js') {
46
47
  content = this.replaceInfo(content);
47
48
  }
48
49
  const ext = (0, path_1.extname)(lastName);
@@ -80,7 +81,8 @@ let SwaggerMiddleware = class SwaggerMiddleware {
80
81
  let content = (0, fs_1.readFileSync)((0, path_1.join)(this.swaggerUiAssetPath, lastName), {
81
82
  encoding: 'utf-8',
82
83
  });
83
- if (lastName === 'index.html') {
84
+ if (lastName === 'index.html' ||
85
+ lastName === 'swagger-initializer.js') {
84
86
  content = this.replaceInfo(content);
85
87
  }
86
88
  const ext = (0, path_1.extname)(lastName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/swagger",
3
- "version": "3.1.6",
3
+ "version": "3.2.1",
4
4
  "main": "dist/index",
5
5
  "typings": "index.d.ts",
6
6
  "files": [
@@ -9,10 +9,10 @@
9
9
  "index.d.ts"
10
10
  ],
11
11
  "devDependencies": {
12
- "@midwayjs/core": "^3.1.6",
12
+ "@midwayjs/core": "^3.2.0",
13
13
  "@midwayjs/decorator": "^3.1.6",
14
- "@midwayjs/koa": "^3.1.6",
15
- "@midwayjs/mock": "^3.1.6",
14
+ "@midwayjs/koa": "^3.2.1",
15
+ "@midwayjs/mock": "^3.2.0",
16
16
  "swagger-ui-dist": "4.6.2"
17
17
  },
18
18
  "author": "Kurten Chan <chinkurten@gmail.com>",
@@ -27,5 +27,5 @@
27
27
  "type": "git",
28
28
  "url": "https://github.com/midwayjs/midway.git"
29
29
  },
30
- "gitHead": "8c157a2b1a23ca2360522dc0de58513098952391"
30
+ "gitHead": "e957e25e353a2e4c56d5ddcce24bb55a10f007ca"
31
31
  }