lianjunwei commented on code in PR #3447:
URL: https://github.com/apache/incubator-shenyu/pull/3447#discussion_r886241753
##########
shenyu-admin/src/main/java/org/apache/shenyu/admin/service/manager/impl/SwaggerDocParser.java:
##########
@@ -56,7 +56,7 @@ public class SwaggerDocParser implements DocParser {
@Override
public DocInfo parseJson(final JSONObject docRoot) {
final String basePath = docRoot.getString("basePath");
- final String title = docRoot.getJSONObject("info").getString("title");
+ final String title =
Optional.ofNullable(docRoot.getJSONObject("info")).map(jsonObject ->
jsonObject.getString("title")).orElse("");
Review Comment:
> 1. Docroot.getjsonobject (" info ") is null, unable to get the title of
the document. It is recommended that contextpath (that is, the value of the
"basepath" variable in the previous line) be the default title of the document,
because it can ensure the uniqueness of the title.
2. Line 168 of the swaggerdocparser class file will also be null, which
is handled as above.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]