forked from loafle/openapi-generator-original
better error message for empty operationId
This commit is contained in:
parent
0f75b053c8
commit
dd34d75f00
@ -531,7 +531,8 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
|||||||
+ " Tag: " + tag + "\n"//
|
+ " Tag: " + tag + "\n"//
|
||||||
+ " Operation: " + operation.getOperationId() + "\n" //
|
+ " Operation: " + operation.getOperationId() + "\n" //
|
||||||
+ " Resource: " + httpMethod + " " + resourcePath + "\n"//
|
+ " Resource: " + httpMethod + " " + resourcePath + "\n"//
|
||||||
+ " Definitions: " + swagger.getDefinitions();
|
+ " Definitions: " + swagger.getDefinitions() + "\n" //
|
||||||
|
+ " Exception: " + ex.getMessage();
|
||||||
throw new RuntimeException(msg, ex);
|
throw new RuntimeException(msg, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -378,7 +378,7 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
public String toOperationId(String operationId) {
|
public String toOperationId(String operationId) {
|
||||||
// throw exception if method name is empty
|
// throw exception if method name is empty
|
||||||
if (StringUtils.isEmpty(operationId)) {
|
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
|
// method name cannot use reserved keyword, e.g. return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user