mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-04 21:19:52 +08:00
fix: swagger 参数描述中带有/导入报错
This commit is contained in:
parent
ec3276edff
commit
cef3c8dea7
@ -130,8 +130,15 @@ public class Swagger2Parser extends ApiImportAbstractParser {
|
||||
Model schema = bodyParameter.getSchema();
|
||||
|
||||
if (schema instanceof RefModel) {
|
||||
String simpleRef = "";
|
||||
RefModel refModel = (RefModel) bodyParameter.getSchema();
|
||||
Model model = definitions.get(refModel.getSimpleRef());
|
||||
String originalRef = refModel.getOriginalRef();
|
||||
if (refModel.getOriginalRef().split("/").length > 3) {
|
||||
simpleRef = originalRef.replace("#/definitions/", "");
|
||||
} else {
|
||||
simpleRef = refModel.getSimpleRef();
|
||||
}
|
||||
Model model = definitions.get(simpleRef);
|
||||
JSONObject bodyParameters = getBodyJSONObjectParameters(model.getProperties(), definitions);
|
||||
body.setRaw(bodyParameters.toJSONString());
|
||||
} else if (schema instanceof ArrayModel) {
|
||||
|
Loading…
Reference in New Issue
Block a user