fix(接口测试): postman文件解析增加格式判断
This commit is contained in:
parent
d29667f185
commit
c707a65f22
|
@ -28,6 +28,7 @@ import io.metersphere.project.dto.environment.auth.DigestAuth;
|
||||||
import io.metersphere.project.dto.environment.auth.HTTPAuthConfig;
|
import io.metersphere.project.dto.environment.auth.HTTPAuthConfig;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
@ -175,7 +176,7 @@ public abstract class PostmanAbstractParserParserApiDefinition<T> extends HttpAp
|
||||||
private static void setRaw(JsonNode bodyNode, MsHTTPElement request) {
|
private static void setRaw(JsonNode bodyNode, MsHTTPElement request) {
|
||||||
JsonNode rawNode = bodyNode.get(RAW);
|
JsonNode rawNode = bodyNode.get(RAW);
|
||||||
JsonNode optionNode = bodyNode.get(OPTIONS);
|
JsonNode optionNode = bodyNode.get(OPTIONS);
|
||||||
if (optionNode != null) {
|
if (ObjectUtils.allNotNull(rawNode, optionNode)) {
|
||||||
if (optionNode instanceof ObjectNode optionObject) {
|
if (optionNode instanceof ObjectNode optionObject) {
|
||||||
JsonNode languageNode = optionObject.get(RAW).get(La);
|
JsonNode languageNode = optionObject.get(RAW).get(La);
|
||||||
if (languageNode instanceof TextNode languageText) {
|
if (languageNode instanceof TextNode languageText) {
|
||||||
|
|
Loading…
Reference in New Issue