fix: 导入插件文件

This commit is contained in:
chenjianxing 2020-07-22 17:00:08 +08:00
parent 159428b4a4
commit 9846a364b6
1 changed files with 2 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import io.metersphere.api.dto.ApiTestImportRequest;
import io.metersphere.api.dto.parse.ApiImport;
import io.metersphere.api.dto.scenario.request.RequestType;
import io.metersphere.commons.constants.MsRequestBodyType;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.jetty.http.HttpMethod;
@ -38,6 +39,7 @@ public class MsParser extends ApiImportAbstractParser {
requestsObject.keySet().forEach(requestName -> {
JSONObject requestObject = requestsObject.getJSONObject(requestName);
requestObject.put("name", requestName);
requestObject.put("type", RequestType.HTTP);
JSONArray bodies = requestObject.getJSONArray("body");
if (StringUtils.equalsIgnoreCase(requestObject.getString("method"), HttpMethod.POST.name()) && bodies != null) {
StringBuilder bodyStr = new StringBuilder();