@midwayjs/swagger 3.9.0 → 3.9.3
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/dist/swaggerExplorer.js +19 -3
- package/package.json +2 -2
package/dist/swaggerExplorer.js
CHANGED
|
@@ -216,9 +216,25 @@ let SwaggerExplorer = class SwaggerExplorer {
|
|
|
216
216
|
}
|
|
217
217
|
if (core_1.Types.isClass(currentType)) {
|
|
218
218
|
this.parseClzz(currentType);
|
|
219
|
-
p.
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
if (p.in === 'query') {
|
|
220
|
+
// 如果@Query()装饰的 是一个对象,则把该对象的子属性作为多个@Query参数
|
|
221
|
+
const schema = this.documentBuilder.getSchema(currentType.name);
|
|
222
|
+
Object.keys(schema.properties).forEach(pName => {
|
|
223
|
+
const ppt = schema.properties[pName];
|
|
224
|
+
const pp = {
|
|
225
|
+
name: pName,
|
|
226
|
+
in: p.in,
|
|
227
|
+
};
|
|
228
|
+
this.parseFromParamsToP({ metadata: ppt }, pp);
|
|
229
|
+
parameters.push(pp);
|
|
230
|
+
});
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
p.schema = {
|
|
235
|
+
$ref: '#/components/schemas/' + currentType.name,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
222
238
|
}
|
|
223
239
|
else {
|
|
224
240
|
p.schema = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/swagger",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.3",
|
|
4
4
|
"main": "dist/index",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"type": "git",
|
|
28
28
|
"url": "https://github.com/midwayjs/midway.git"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "3cd5d856789433bcfab6bcdce87743035176c878"
|
|
31
31
|
}
|