@midwayjs/swagger 3.4.13 → 3.5.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.
@@ -1,3 +1,4 @@
1
+ import { Type } from './interfaces';
1
2
  export declare class SwaggerExplorer {
2
3
  private swaggerConfig;
3
4
  private documentBuilder;
@@ -5,7 +6,7 @@ export declare class SwaggerExplorer {
5
6
  addGlobalPrefix(prefix: string): void;
6
7
  scanApp(): void;
7
8
  getData(): Omit<import("./interfaces").OpenAPIObject, "paths">;
8
- private generatePath;
9
+ protected generatePath(target: Type): void;
9
10
  /**
10
11
  * 构造 router 提取方法
11
12
  */
@@ -501,12 +501,6 @@ let SwaggerExplorer = class SwaggerExplorer {
501
501
  Object.keys(props).forEach(key => {
502
502
  var _a, _b;
503
503
  const metadata = props[key].metadata;
504
- if (typeof (metadata === null || metadata === void 0 ? void 0 : metadata.example) !== undefined) {
505
- if (!tt.example) {
506
- tt.example = {};
507
- }
508
- tt.example[key] = metadata === null || metadata === void 0 ? void 0 : metadata.example;
509
- }
510
504
  if (typeof (metadata === null || metadata === void 0 ? void 0 : metadata.required) !== undefined) {
511
505
  if (metadata === null || metadata === void 0 ? void 0 : metadata.required) {
512
506
  if (!tt.required) {
@@ -552,13 +546,13 @@ let SwaggerExplorer = class SwaggerExplorer {
552
546
  tt.properties[key] = {
553
547
  type: 'array',
554
548
  items: {
555
- $ref: '#components/schemas/' + (currentType === null || currentType === void 0 ? void 0 : currentType.name),
549
+ $ref: '#/components/schemas/' + (currentType === null || currentType === void 0 ? void 0 : currentType.name),
556
550
  },
557
551
  };
558
552
  }
559
553
  else {
560
554
  tt.properties[key] = {
561
- $ref: '#components/schemas/' + (currentType === null || currentType === void 0 ? void 0 : currentType.name),
555
+ $ref: '#/components/schemas/' + (currentType === null || currentType === void 0 ? void 0 : currentType.name),
562
556
  };
563
557
  }
564
558
  delete metadata.items;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/swagger",
3
- "version": "3.4.13",
3
+ "version": "3.5.2",
4
4
  "main": "dist/index",
5
5
  "typings": "index.d.ts",
6
6
  "files": [
@@ -9,12 +9,12 @@
9
9
  "index.d.ts"
10
10
  ],
11
11
  "devDependencies": {
12
- "@midwayjs/core": "^3.4.13",
12
+ "@midwayjs/core": "^3.5.1",
13
13
  "@midwayjs/decorator": "^3.4.11",
14
- "@midwayjs/koa": "^3.4.13",
15
- "@midwayjs/mock": "^3.4.13",
16
- "@midwayjs/validate": "^3.4.13",
17
- "swagger-ui-dist": "4.13.2"
14
+ "@midwayjs/koa": "^3.5.1",
15
+ "@midwayjs/mock": "^3.5.1",
16
+ "@midwayjs/validate": "^3.5.2",
17
+ "swagger-ui-dist": "4.14.0"
18
18
  },
19
19
  "author": "Kurten Chan <chinkurten@gmail.com>",
20
20
  "license": "MIT",
@@ -28,5 +28,5 @@
28
28
  "type": "git",
29
29
  "url": "https://github.com/midwayjs/midway.git"
30
30
  },
31
- "gitHead": "bde878f01df0a4b27919eea367d100b5ee5edb04"
31
+ "gitHead": "bfdca205f0c9321066ec480cd244eee043dccab0"
32
32
  }