fix(接口测试): 优化swagger响应体的校验方式
--bug=1046351 --user=宋天阳 【接口测试】github#33025,接口定义通过swagger导入,swagger中ResponseResult中有《》这个符号就会报错,报数据解析错误,V2和V3的最新版本均有这个问题 https://www.tapd.cn/55049933/s/1578840
This commit is contained in:
parent
36242372f1
commit
bfaa4994d8
|
@ -316,8 +316,12 @@ public class Swagger3ParserApiDefinition extends HttpApiDefinitionImportAbstract
|
||||||
case MediaType.APPLICATION_XML_VALUE -> {
|
case MediaType.APPLICATION_XML_VALUE -> {
|
||||||
body.setBodyType(Body.BodyType.XML.name());
|
body.setBodyType(Body.BodyType.XML.name());
|
||||||
XmlBody xml = new XmlBody();
|
XmlBody xml = new XmlBody();
|
||||||
|
try {
|
||||||
String xmlBody = parseXmlBody(value, jsonSchemaItem);
|
String xmlBody = parseXmlBody(value, jsonSchemaItem);
|
||||||
xml.setValue(xmlBody);
|
xml.setValue(xmlBody);
|
||||||
|
} catch (Exception e) {
|
||||||
|
xml.setValue(e.getMessage());
|
||||||
|
}
|
||||||
body.setXmlBody(xml);
|
body.setXmlBody(xml);
|
||||||
}
|
}
|
||||||
case MediaType.MULTIPART_FORM_DATA_VALUE -> {
|
case MediaType.MULTIPART_FORM_DATA_VALUE -> {
|
||||||
|
|
Loading…
Reference in New Issue