Merge pull request #3252 from alexralko/master

add getHasExamples() method to support {{hasExamples}} tag in templates
This commit is contained in:
wing328 2016-07-01 17:43:07 +08:00 committed by GitHub
commit f8bf4387c3

View File

@ -42,10 +42,10 @@ public class CodegenOperation {
*
* @return true if parameter exists, false otherwise
*/
private static boolean nonempty(List<CodegenParameter> params) {
private static boolean nonempty(List<?> params) {
return params != null && params.size() > 0;
}
/**
* Check if there's at least one body parameter
*
@ -91,6 +91,15 @@ public class CodegenOperation {
return nonempty(formParams);
}
/**
* Check if there's at least one example parameter
*
* @return true if examples parameter exists, false otherwise
*/
public boolean getHasExamples() {
return nonempty(examples);
}
/**
* Check if act as Restful index method
*