mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 06:30:52 +00:00
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
|
||||
*/
|
||||
private static boolean nonempty(List<CodegenParameter> params) {
|
||||
private static boolean nonempty(List<?> params) {
|
||||
return params != null && params.size() > 0;
|
||||
}
|
||||
|
||||
@ -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
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user