fix(接口测试): postman文件解析增加格式判断

This commit is contained in:
Jianguo-Genius 2024-08-23 18:20:25 +08:00 committed by Craftsman
parent d29667f185
commit c707a65f22

View File

@ -28,6 +28,7 @@ import io.metersphere.project.dto.environment.auth.DigestAuth;
import io.metersphere.project.dto.environment.auth.HTTPAuthConfig;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
@ -175,7 +176,7 @@ public abstract class PostmanAbstractParserParserApiDefinition<T> extends HttpAp
private static void setRaw(JsonNode bodyNode, MsHTTPElement request) {
JsonNode rawNode = bodyNode.get(RAW);
JsonNode optionNode = bodyNode.get(OPTIONS);
if (optionNode != null) {
if (ObjectUtils.allNotNull(rawNode, optionNode)) {
if (optionNode instanceof ObjectNode optionObject) {
JsonNode languageNode = optionObject.get(RAW).get(La);
if (languageNode instanceof TextNode languageText) {