fix(接口测试): 导入swagger问题处理

--bug=1007229 --user=赵勇 [github#6835]接口导出后导入,响应内容中的描述信息没有了,同时请求参数中的值没有了 https://www.tapd.cn/55049933/s/1065451
This commit is contained in:
fit2-zhao 2021-11-08 16:41:59 +08:00 committed by fit2-zhao
parent 3ba19fbf5b
commit 5c79c49b84
1 changed files with 7 additions and 1 deletions

View File

@ -368,8 +368,14 @@ public class Swagger3Parser extends SwaggerAbstractParser {
return jsonArray;
} else if (schema instanceof BinarySchema) {
return getDefaultValueByPropertyType(schema);
} else if (schema instanceof ObjectSchema) {
Object propertiesResult = parseSchemaProperties(schema, refSet, infoMap);
return propertiesResult == null ? getDefaultValueByPropertyType(schema) : propertiesResult;
} else {
if (schema.getType() != null) { // 特判属性不是对象的情况直接将基本类型赋值进去
if (schema instanceof StringSchema) {
StringSchema stringSchema = (StringSchema) schema;
return stringSchema.getExample();
} else if (schema.getType() != null) { // 特判属性不是对象的情况直接将基本类型赋值进去
return schema;
}
Object propertiesResult = parseSchemaProperties(schema, refSet, infoMap);