Skip to content

Commit f8bf438

Browse files
authored
Merge pull request #3252 from alexralko/master
add getHasExamples() method to support {{hasExamples}} tag in templates
2 parents 33b4afc + a862601 commit f8bf438

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ public class CodegenOperation {
4242
*
4343
* @return true if parameter exists, false otherwise
4444
*/
45-
private static boolean nonempty(List<CodegenParameter> params) {
45+
private static boolean nonempty(List<?> params) {
4646
return params != null && params.size() > 0;
4747
}
48-
48+
4949
/**
5050
* Check if there's at least one body parameter
5151
*
@@ -91,6 +91,15 @@ public boolean getHasFormParams() {
9191
return nonempty(formParams);
9292
}
9393

94+
/**
95+
* Check if there's at least one example parameter
96+
*
97+
* @return true if examples parameter exists, false otherwise
98+
*/
99+
public boolean getHasExamples() {
100+
return nonempty(examples);
101+
}
102+
94103
/**
95104
* Check if act as Restful index method
96105
*

0 commit comments

Comments
 (0)