fix(接口测试): 解决swagger接口导入丢失数据问题

--user=郭雨琦
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001016219
This commit is contained in:
guoyuqi 2022-08-24 16:15:25 +08:00 committed by f2c-ci-robot[bot]
parent 04ffade260
commit 36f1b39964
1 changed files with 6 additions and 1 deletions

View File

@ -379,10 +379,15 @@ public class Swagger3Parser extends SwaggerAbstractParser {
} else if (schema instanceof ObjectSchema) {
Object propertiesResult = parseSchemaPropertiesToJson(schema, refSet, infoMap);
return propertiesResult == null ? getDefaultValueByPropertyType(schema) : propertiesResult;
} else {
if (MapUtils.isNotEmpty(schema.getProperties())) {
Object propertiesResult = parseSchemaPropertiesToJson(schema, refSet, infoMap);
return propertiesResult == null ? getDefaultValueByPropertyType(schema) : propertiesResult;
} else {
return getDefaultValueByPropertyType(schema);
}
}
}
private Object parseSchemaPropertiesToJson(Schema schema, Set<String> refSet, Map<String, Schema> infoMap) {
if (schema == null) return null;