File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
src/main/java/com/spring4all/swagger Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1616import org .springframework .boot .context .properties .EnableConfigurationProperties ;
1717import org .springframework .context .annotation .Bean ;
1818import org .springframework .context .annotation .Configuration ;
19+ import org .springframework .util .CollectionUtils ;
1920
2021import com .google .common .base .Predicates ;
2122
3435 * @author 程序猿DD
3536 * @author andi.lin
3637 *
37- * Created on 2017/8/7
38- * Update on 2021/8/13
38+ * Created on 2017/8/7 Update on 2021/8/13
3939 */
4040@ Configuration
4141@ EnableConfigurationProperties (SwaggerProperties .class )
@@ -150,6 +150,10 @@ public void createSpringFoxRestApi() {
150150 * @return RequestParameter {@link RequestParameter}
151151 */
152152 private List <RequestParameter > getRequestParameters (List <SwaggerProperties .GlobalOperationParameter > properties ) {
153+ if (CollectionUtils .isEmpty (properties )) {
154+ return new ArrayList <>();
155+ }
156+
153157 return properties .stream ()
154158 .map (param -> new RequestParameterBuilder ().name (param .getName ()).description (param .getDescription ())
155159 .in (ParameterType .from (param .getParameterType ())).required (param .getRequired ())
@@ -163,8 +167,10 @@ private List<RequestParameter> getRequestParameters(List<SwaggerProperties.Globa
163167 /**
164168 * 局部参数按照name覆盖局部参数
165169 *
166- * @param globalRequestParameters 全局配置
167- * @param groupRequestParameters Group 的配置
170+ * @param globalRequestParameters
171+ * 全局配置
172+ * @param groupRequestParameters
173+ * Group 的配置
168174 * @return 汇总配置
169175 */
170176 private List <RequestParameter > assemblyRequestParameters (
You can’t perform that action at this time.
0 commit comments