mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-05-16 08:31:26 +00:00
Fixed issue that model name not camelized in python client and ruby client
This commit is contained in:
@@ -199,6 +199,8 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
|
||||
@Override
|
||||
public String toModelName(String name) {
|
||||
name = name.replaceAll("\\W", "_");
|
||||
|
||||
// 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 = name.replaceAll("\\W", "_");
|
||||
|
||||
// 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");
|
||||
|
||||
Reference in New Issue
Block a user