fix(接口测试): 修复swagger导入报空指针的缺陷

--bug=1014264 --user=王孝刚 【接口测试】更多操作-接口导入swagger-url-导入报错
https://www.tapd.cn/55049933/s/1187329
This commit is contained in:
wxg0103 2022-06-21 10:50:46 +08:00 committed by f2c-ci-robot[bot]
parent 8417287b00
commit 411168eb84
1 changed files with 1 additions and 1 deletions

View File

@ -524,7 +524,7 @@ public class Swagger3Parser extends SwaggerAbstractParser {
return example == null ? 0 : example;
} else if (value instanceof NumberSchema) {
return example == null ? 0.0 : example;
} else if (value instanceof StringSchema || value.getType().equals("string")) {
} else if (value instanceof StringSchema || StringUtils.equals("string", value.getType())) {
return example == null ? "" : example;
} else {// todo 其他类型?
return getDefaultStringValue(value.getDescription());