better error message for empty operationId

This commit is contained in:
wing328 2015-10-23 12:46:44 +08:00
parent 0f75b053c8
commit dd34d75f00
2 changed files with 3 additions and 2 deletions

View File

@ -531,7 +531,8 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
+ " Tag: " + tag + "\n"//
+ " Operation: " + operation.getOperationId() + "\n" //
+ " Resource: " + httpMethod + " " + resourcePath + "\n"//
+ " Definitions: " + swagger.getDefinitions();
+ " Definitions: " + swagger.getDefinitions() + "\n" //
+ " Exception: " + ex.getMessage();
throw new RuntimeException(msg, ex);
}
}

View File

@ -378,7 +378,7 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
public String toOperationId(String operationId) {
// throw exception if method name is empty
if (StringUtils.isEmpty(operationId)) {
throw new RuntimeException("Empty method name (operationId) not allowed");
throw new RuntimeException("Empty method/operation name (operationId) not allowed");
}
// method name cannot use reserved keyword, e.g. return