From be4868ba01f6becc6971772f729b61f11f598b10 Mon Sep 17 00:00:00 2001 From: tanghc Date: Thu, 22 Aug 2019 20:15:19 +0800 Subject: [PATCH] 2.0 --- .../com/gitee/sop/websiteserver/manager/SwaggerDocParser.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/SwaggerDocParser.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/SwaggerDocParser.java index c75e22bf..7c5a99b8 100644 --- a/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/SwaggerDocParser.java +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/SwaggerDocParser.java @@ -200,7 +200,7 @@ public class SwaggerDocParser implements DocParser { } protected String getResponseRef(JSONObject docInfo) { - String ref = Optional.ofNullable(docInfo.getJSONObject("responses")) + return Optional.ofNullable(docInfo.getJSONObject("responses")) .flatMap(jsonObject -> Optional.ofNullable(jsonObject.getJSONObject("200"))) .flatMap(jsonObject -> Optional.ofNullable(jsonObject.getJSONObject("schema"))) .flatMap(jsonObject -> { @@ -216,7 +216,6 @@ public class SwaggerDocParser implements DocParser { return Optional.of($ref); }) .orElse(""); - return ref; } }