fix: 接口定义导出swagger报错
This commit is contained in:
parent
74cd21ce5e
commit
5033aa4d2c
|
@ -736,7 +736,9 @@ public class Swagger3Parser extends SwaggerAbstractParser {
|
||||||
} catch (Exception e1) { // 若请求体 json 不合法,则忽略错误,原样字符串导出/导入
|
} catch (Exception e1) { // 若请求体 json 不合法,则忽略错误,原样字符串导出/导入
|
||||||
bodyInfo = new JSONObject();
|
bodyInfo = new JSONObject();
|
||||||
((JSONObject) bodyInfo).put("type", "string");
|
((JSONObject) bodyInfo).put("type", "string");
|
||||||
((JSONObject) bodyInfo).put("example", body.get("raw").toString());
|
if (body != null && body.get("raw") != null) {
|
||||||
|
((JSONObject) bodyInfo).put("example", body.get("raw").toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if(bodyType.equals("XML")) {
|
} else if(bodyType.equals("XML")) {
|
||||||
String xmlText = body.getString("raw");
|
String xmlText = body.getString("raw");
|
||||||
|
|
Loading…
Reference in New Issue