fix: swagger 名称为空报错
This commit is contained in:
parent
1f51cb63e0
commit
a259db45bc
|
@ -97,8 +97,10 @@ public class Swagger2Parser extends ApiImportAbstractParser {
|
||||||
String name = "";
|
String name = "";
|
||||||
if (StringUtils.isNotBlank(operation.getSummary())) {
|
if (StringUtils.isNotBlank(operation.getSummary())) {
|
||||||
name = operation.getSummary();
|
name = operation.getSummary();
|
||||||
} else {
|
} else if (StringUtils.isNotBlank(operation.getOperationId())) {
|
||||||
name = operation.getOperationId();
|
name = operation.getOperationId();
|
||||||
|
} else {
|
||||||
|
name = path;
|
||||||
}
|
}
|
||||||
return buildApiDefinition(id, name, path, method);
|
return buildApiDefinition(id, name, path, method);
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,8 +129,10 @@ public class Swagger3Parser extends ApiImportAbstractParser {
|
||||||
String name = "";
|
String name = "";
|
||||||
if (StringUtils.isNotBlank(operation.getSummary())) {
|
if (StringUtils.isNotBlank(operation.getSummary())) {
|
||||||
name = operation.getSummary();
|
name = operation.getSummary();
|
||||||
} else {
|
} else if (StringUtils.isNotBlank(operation.getOperationId())) {
|
||||||
name = operation.getOperationId();
|
name = operation.getOperationId();
|
||||||
|
} else {
|
||||||
|
name = path;
|
||||||
}
|
}
|
||||||
return buildApiDefinition(id, name, path, method);
|
return buildApiDefinition(id, name, path, method);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue