fix(接口测试): 修复创建场景报错的缺陷
This commit is contained in:
parent
cb8076dd23
commit
6f31c0964f
|
@ -1166,10 +1166,10 @@ public class Swagger3Parser extends SwaggerAbstractParser {
|
|||
statusCodeInfo.put("content", buildContent(response, schemas));
|
||||
statusCodeInfo.put("description", StringUtils.EMPTY);
|
||||
JSONObject jsonObject = statusCode.getJSONObject(i);
|
||||
if (jsonObject.optString("value") != null) {
|
||||
if (StringUtils.isNotBlank(jsonObject.optString("value"))) {
|
||||
statusCodeInfo.put("description", jsonObject.optString("value"));
|
||||
}
|
||||
if (jsonObject.optString("name") != null) {
|
||||
if (StringUtils.isNotBlank(jsonObject.optString("name"))) {
|
||||
responseBody.put(jsonObject.optString("name"), statusCodeInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -732,7 +732,7 @@ public class ApiScenarioService {
|
|||
ElementUtil.dataFormatting(element);
|
||||
scenarioWithBLOBs.setScenarioDefinition(element.toString());
|
||||
}
|
||||
if (StringUtils.isNotBlank(scenarioWithBLOBs.getEnvironmentJson())) {
|
||||
if (scenarioWithBLOBs != null && StringUtils.isNotBlank(scenarioWithBLOBs.getEnvironmentJson())) {
|
||||
ApiScenarioEnvRequest request = new ApiScenarioEnvRequest();
|
||||
request.setEnvironmentEnable(false);
|
||||
request.setDefinition(scenarioWithBLOBs.getScenarioDefinition());
|
||||
|
|
Loading…
Reference in New Issue