Skip to content

Commit 3c955d7

Browse files
authored
Merge pull request #10358 from swagger-api/bezineb5-patch-1
Bezineb5 patch 1
2 parents 9f809ab + b719a24 commit 3c955d7

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/v3/CodegenOperation.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,22 @@ public boolean getHasBodyParam() {
6565
* @return true if query parameter exists, false otherwise
6666
*/
6767
public boolean getHasQueryParams() {
68-
return nonempty(queryParams);
68+
if (nonempty(queryParams)) {
69+
return true;
70+
}
71+
72+
if (authMethods == null || authMethods.isEmpty()) {
73+
return false;
74+
}
75+
76+
// Check if one of the authMethods is a query param
77+
for (CodegenSecurity sec : authMethods) {
78+
if (sec.getIsKeyInQuery()) {
79+
return true;
80+
}
81+
}
82+
83+
return false;
6984
}
7085

7186
/**

0 commit comments

Comments
 (0)