File tree 1 file changed +10
-4
lines changed
src/main/java/com/spring4all/swagger
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 16
16
import org .springframework .boot .context .properties .EnableConfigurationProperties ;
17
17
import org .springframework .context .annotation .Bean ;
18
18
import org .springframework .context .annotation .Configuration ;
19
+ import org .springframework .util .CollectionUtils ;
19
20
20
21
import com .google .common .base .Predicates ;
21
22
34
35
* @author 程序猿DD
35
36
* @author andi.lin
36
37
*
37
- * Created on 2017/8/7
38
- * Update on 2021/8/13
38
+ * Created on 2017/8/7 Update on 2021/8/13
39
39
*/
40
40
@ Configuration
41
41
@ EnableConfigurationProperties (SwaggerProperties .class )
@@ -150,6 +150,10 @@ public void createSpringFoxRestApi() {
150
150
* @return RequestParameter {@link RequestParameter}
151
151
*/
152
152
private List <RequestParameter > getRequestParameters (List <SwaggerProperties .GlobalOperationParameter > properties ) {
153
+ if (CollectionUtils .isEmpty (properties )) {
154
+ return new ArrayList <>();
155
+ }
156
+
153
157
return properties .stream ()
154
158
.map (param -> new RequestParameterBuilder ().name (param .getName ()).description (param .getDescription ())
155
159
.in (ParameterType .from (param .getParameterType ())).required (param .getRequired ())
@@ -163,8 +167,10 @@ private List<RequestParameter> getRequestParameters(List<SwaggerProperties.Globa
163
167
/**
164
168
* 局部参数按照name覆盖局部参数
165
169
*
166
- * @param globalRequestParameters 全局配置
167
- * @param groupRequestParameters Group 的配置
170
+ * @param globalRequestParameters
171
+ * 全局配置
172
+ * @param groupRequestParameters
173
+ * Group 的配置
168
174
* @return 汇总配置
169
175
*/
170
176
private List <RequestParameter > assemblyRequestParameters (
You can’t perform that action at this time.
0 commit comments