fix(接口测试): 解决接口定义导出swagger失败
--bug=1011524 --user=郭雨琦 【接口测试】-接口定义中导出全部数据为swagger格式失败 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001011524
This commit is contained in:
parent
9dfe528e9e
commit
049ebe6e49
|
@ -947,7 +947,9 @@ public class Swagger3Parser extends SwaggerAbstractParser {
|
|||
} else if (bodyType.equalsIgnoreCase("RAW")) {
|
||||
bodyInfo = new JSONObject();
|
||||
((JSONObject) bodyInfo).put("type", "string");
|
||||
if (body != null && body.get("raw") != null) {
|
||||
((JSONObject) bodyInfo).put("example", body.get("raw").toString());
|
||||
}
|
||||
} else if (bodyType.equalsIgnoreCase("XML")) {
|
||||
String xmlText = body.getString("raw");
|
||||
JSONObject xmlToJson = XMLUtils.XmlToJson(xmlText);
|
||||
|
|
Loading…
Reference in New Issue