@midwayjs/swagger 3.3.6 → 3.3.14
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 +2 -5
- package/dist/swaggerExplorer.js +9 -2
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# midway swagger module
|
|
2
2
|
|
|
3
3
|
## Thanks to [@nestjs/swagger](https://github.com/nestjs/swagger)
|
|
4
4
|
|
|
5
|
-
[](http://packagequality.com/#?package=midway-core)
|
|
6
|
-
[](https://github.com/midwayjs/midway/pulls)
|
|
7
|
-
|
|
8
5
|
this is a sub package for midway.
|
|
9
6
|
|
|
10
|
-
Document: [https://midwayjs.org
|
|
7
|
+
Document: [https://midwayjs.org](https://midwayjs.org)
|
|
11
8
|
|
|
12
9
|
## License
|
|
13
10
|
|
package/dist/swaggerExplorer.js
CHANGED
|
@@ -497,7 +497,6 @@ let SwaggerExplorer = class SwaggerExplorer {
|
|
|
497
497
|
tt.example = {};
|
|
498
498
|
}
|
|
499
499
|
tt.example[key] = metadata === null || metadata === void 0 ? void 0 : metadata.example;
|
|
500
|
-
delete metadata.example;
|
|
501
500
|
}
|
|
502
501
|
if (typeof (metadata === null || metadata === void 0 ? void 0 : metadata.required) !== undefined) {
|
|
503
502
|
if (metadata === null || metadata === void 0 ? void 0 : metadata.required) {
|
|
@@ -553,6 +552,7 @@ let SwaggerExplorer = class SwaggerExplorer {
|
|
|
553
552
|
$ref: '#components/schemas/' + (currentType === null || currentType === void 0 ? void 0 : currentType.name),
|
|
554
553
|
};
|
|
555
554
|
}
|
|
555
|
+
delete metadata.items;
|
|
556
556
|
}
|
|
557
557
|
else {
|
|
558
558
|
if (isArray) {
|
|
@@ -562,7 +562,6 @@ let SwaggerExplorer = class SwaggerExplorer {
|
|
|
562
562
|
type: 'array',
|
|
563
563
|
items: metadata === null || metadata === void 0 ? void 0 : metadata.items,
|
|
564
564
|
};
|
|
565
|
-
delete metadata.items;
|
|
566
565
|
}
|
|
567
566
|
else {
|
|
568
567
|
tt.properties[key] = {
|
|
@@ -572,12 +571,20 @@ let SwaggerExplorer = class SwaggerExplorer {
|
|
|
572
571
|
},
|
|
573
572
|
};
|
|
574
573
|
}
|
|
574
|
+
delete metadata.items;
|
|
575
575
|
}
|
|
576
576
|
else {
|
|
577
577
|
tt.properties[key] = {
|
|
578
578
|
type: (0, decorator_1.getPropertyType)(clzz.prototype, key).name,
|
|
579
579
|
format: metadata === null || metadata === void 0 ? void 0 : metadata.format,
|
|
580
580
|
};
|
|
581
|
+
// Date 类型支持
|
|
582
|
+
if (tt.properties[key].type === 'Date') {
|
|
583
|
+
tt.properties[key].type = 'string';
|
|
584
|
+
if (!tt.properties[key].format) {
|
|
585
|
+
tt.properties[key].format = 'date';
|
|
586
|
+
}
|
|
587
|
+
}
|
|
581
588
|
delete metadata.format;
|
|
582
589
|
}
|
|
583
590
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/swagger",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.14",
|
|
4
4
|
"main": "dist/index",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"@midwayjs/decorator": "^3.3.4",
|
|
14
14
|
"@midwayjs/koa": "^3.3.6",
|
|
15
15
|
"@midwayjs/mock": "^3.3.5",
|
|
16
|
+
"@midwayjs/validate": "^3.3.11",
|
|
16
17
|
"swagger-ui-dist": "4.6.2"
|
|
17
18
|
},
|
|
18
19
|
"author": "Kurten Chan <chinkurten@gmail.com>",
|
|
@@ -27,5 +28,5 @@
|
|
|
27
28
|
"type": "git",
|
|
28
29
|
"url": "https://github.com/midwayjs/midway.git"
|
|
29
30
|
},
|
|
30
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "01bbc493f384e137751f250d3d0175773cfcabef"
|
|
31
32
|
}
|