fix operation id starting with number for python client (#682)

This commit is contained in:
William Cheng 2018-07-30 15:42:06 +08:00 committed by GitHub
parent b587052de4
commit 036fa6918c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -552,6 +552,12 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
operationId = "call_" + operationId;
}
// model name starts with a number
if (operationId.matches("^\\d.*")) {
LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + underscore(sanitizeName("call_" + operationId)));
operationId = "call_" + operationId;
}
return underscore(sanitizeName(operationId));
}

View File

@ -1 +1 @@
3.1.1-SNAPSHOT
3.2.0-SNAPSHOT