mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 11:23:58 +00:00
add getHasExamples() method to support {{hasExamples}} tag in templates
This commit is contained in:
parent
acc28495e8
commit
a862601482
@ -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…
Reference in New Issue
Block a user