fix(TCP-Mock、Json-schema): #1007848 【github#7666】TCP mock的json raw点击无响应、jesonschema转换时健的顺序错序
--bug=1007848 --user=宋天阳 【github#7666】TCP mock的json raw点击无响应 https://www.tapd.cn/55049933/s/1067738、jesonschema转换时健的顺序错序
This commit is contained in:
parent
a199d9f139
commit
1b161e3cac
|
@ -210,7 +210,7 @@ public class JSONSchemaGenerator {
|
|||
array.add(0);
|
||||
}
|
||||
} else if (itemsObject.has("properties")) {
|
||||
JSONObject propertyConcept = new JSONObject();
|
||||
JSONObject propertyConcept = new JSONObject(true);
|
||||
JsonObject propertiesObj = itemsObject.get("properties").getAsJsonObject();
|
||||
for (Entry<String, JsonElement> entry : propertiesObj.entrySet()) {
|
||||
String propertyKey = entry.getKey();
|
||||
|
@ -229,13 +229,13 @@ public class JSONSchemaGenerator {
|
|||
array.add(itemsObjectArray);
|
||||
}
|
||||
}
|
||||
|
||||
concept.put(propertyName, array);
|
||||
|
||||
} else if (propertyObjType.equals("object")) {
|
||||
JSONObject obj = new JSONObject();
|
||||
concept.put(propertyName, obj);
|
||||
analyzeObject(object, obj);
|
||||
} else if (StringUtils.equalsIgnoreCase(propertyObjType,"null")) {
|
||||
concept.put(propertyName, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -274,7 +274,7 @@ public class JSONSchemaGenerator {
|
|||
|
||||
private static String formerJson(String jsonSchema) {
|
||||
try {
|
||||
JSONObject root = new JSONObject();
|
||||
JSONObject root = new JSONObject(true);
|
||||
generator(jsonSchema, root);
|
||||
// 格式化返回
|
||||
Gson gson = new GsonBuilder().serializeNulls().setPrettyPrinting().disableHtmlEscaping().create();
|
||||
|
|
|
@ -86,6 +86,7 @@ export default {
|
|||
name: "",
|
||||
mockConfigId: "",
|
||||
request: {
|
||||
reportType: "raw",
|
||||
jsonParam: false,
|
||||
variables: [],
|
||||
jsonData: "{}",
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<ms-mock :disabled="pickValue.type==='object' || pickValue.type==='array'" :schema="pickValue"/>
|
||||
<ms-mock :disabled="pickValue.type==='object' || pickValue.type==='array' || pickValue.type==='null'" :schema="pickValue"/>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-input v-model="pickValue.description" class="ms-col-title" :placeholder="$t('schema.description')" size="small"/>
|
||||
|
|
Loading…
Reference in New Issue