fix(接口测试): 修复由于修改接口导入对example处理问题而产生的问题

--bug=1021408--user=郭雨琦
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001021408
This commit is contained in:
guoyuqi 2022-12-30 14:57:39 +08:00 committed by xiaomeinvG
parent 474ea08815
commit b15910316e
1 changed files with 1 additions and 1 deletions

View File

@ -330,7 +330,7 @@ public class Swagger3Parser extends SwaggerAbstractParser {
Set<String> refSet = new HashSet<>();
Map<String, Schema> infoMap = new HashMap();
Schema schema = getSchema(mediaType.getSchema());
if (content.get(contentType).getExample() != null && schema.getExample() == null) {
if (content.get(contentType) != null && content.get(contentType).getExample() != null && schema.getExample() == null) {
schema.setExample(content.get(contentType).getExample());
}
Object bodyData = null;