mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 19:33:55 +00:00
Merge pull request #1290 from geekerzp/model_name
[Python, Ruby] Fix issues in python and ruby clients
This commit is contained in:
commit
2ea3816e65
@ -199,6 +199,8 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
|
||||
@Override
|
||||
public String toModelName(String name) {
|
||||
name = sanitizeName(name);
|
||||
|
||||
// model name cannot use reserved keyword, e.g. return
|
||||
if (reservedWords.contains(name)) {
|
||||
throw new RuntimeException(name + " (reserved word) cannot be used as a model name");
|
||||
|
@ -224,6 +224,8 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
|
||||
@Override
|
||||
public String toModelName(String name) {
|
||||
name = sanitizeName(name);
|
||||
|
||||
// model name cannot use reserved keyword, e.g. return
|
||||
if (reservedWords.contains(name)) {
|
||||
throw new RuntimeException(name + " (reserved word) cannot be used as a model name");
|
||||
|
@ -435,7 +435,7 @@ class UserApi(object):
|
||||
|
||||
:param callback function: The callback function
|
||||
for asynchronous request. (optional)
|
||||
:param str username: The name that needs to be fetched. Use user1 for testing. (required)
|
||||
:param str username: The name that needs to be fetched. Use user1 for testing. (required)
|
||||
:return: User
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
|
Loading…
Reference in New Issue
Block a user