fix(接口测试): 导出swagger再导入其他平台缺少值

--user=郭雨琦
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001016562
This commit is contained in:
guoyuqi 2022-09-06 16:46:46 +08:00 committed by f2c-ci-robot[bot]
parent 6f7a06ebd4
commit 0a35673ad1
1 changed files with 3 additions and 8 deletions

View File

@ -684,14 +684,9 @@ public class Swagger3Parser extends SwaggerAbstractParser {
swaggerParam.setName((String) param.get("name"));
swaggerParam.setRequired((boolean) param.get("required"));
swaggerParam.setExample((String) param.get("value"));
// 请求头 value 没有导出
// JSONObject schema = new JSONObject();
// swaggerParam.setSchema(schema);
// if(type.equals("headers")) {
// schema.put("type", "string");
// schema.put("example", param.getString("value"));
// swaggerParam.setSchema(schema);
// }
JSONObject schema = new JSONObject();
schema.put("type", "string");
swaggerParam.setSchema(schema);
paramsList.add(JSON.parseObject(JSON.toJSONString(swaggerParam), Feature.DisableSpecialKeyDetect));
}
}