forked from loafle/openapi-generator-original
Merge pull request #3252 from alexralko/master
add getHasExamples() method to support {{hasExamples}} tag in templates
This commit is contained in:
commit
f8bf4387c3
@ -42,7 +42,7 @@ public class CodegenOperation {
|
|||||||
*
|
*
|
||||||
* @return true if parameter exists, false otherwise
|
* @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;
|
return params != null && params.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,6 +91,15 @@ public class CodegenOperation {
|
|||||||
return nonempty(formParams);
|
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
|
* Check if act as Restful index method
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user