add getHasExamples() method to support {{hasExamples}} tag in templates

This commit is contained in:
Alex Ralko 2016-06-29 18:56:45 +03:00 committed by GitHub
parent acc28495e8
commit a862601482

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
*