This commit is contained in:
fit2-zhao 2021-01-22 18:18:26 +08:00
commit 5ae9f4dcfe
2 changed files with 15 additions and 3 deletions

View File

@ -270,7 +270,12 @@ public class Swagger2Parser extends SwaggerAbstractParser {
refSet.add(simpleRef);
Model model = this.definitions.get(simpleRef);
JSONArray propertyList = new JSONArray();
propertyList.add(getBodyParameters(model.getProperties(), refSet));
if (model != null) {
propertyList.add(getBodyParameters(model.getProperties(), refSet));
} else {
propertyList.add(new JSONObject());
}
jsonObject.put(key, propertyList);
} else {
jsonObject.put(key, new ArrayList<>());

View File

@ -49,7 +49,8 @@
},
methods: {
validateSocket(socket) {
if (!socket) return true;
// if (!socket) return true;
if (socket !== ''){
let urlStr = this.httpConfig.protocol + '://' + socket;
let url = {};
try {
@ -58,7 +59,6 @@
return false;
}
this.httpConfig.domain = decodeURIComponent(url.hostname);
this.httpConfig.port = url.port;
let path = url.pathname === '/' ? '' : url.pathname;
if (url.port) {
@ -67,6 +67,13 @@
this.httpConfig.socket = this.httpConfig.domain + path;
}
return true;
}else {
this.httpConfig.domain = socket;
this.httpConfig.port = '';
this.httpConfig.socket = socket;
return true;
}
},
validate() {
let isValidate = false;