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); refSet.add(simpleRef);
Model model = this.definitions.get(simpleRef); Model model = this.definitions.get(simpleRef);
JSONArray propertyList = new JSONArray(); JSONArray propertyList = new JSONArray();
if (model != null) {
propertyList.add(getBodyParameters(model.getProperties(), refSet)); propertyList.add(getBodyParameters(model.getProperties(), refSet));
} else {
propertyList.add(new JSONObject());
}
jsonObject.put(key, propertyList); jsonObject.put(key, propertyList);
} else { } else {
jsonObject.put(key, new ArrayList<>()); jsonObject.put(key, new ArrayList<>());

View File

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