forked from loafle/openapi-generator-original
Handle model names starting with number (#4276)
This commit is contained in:
parent
2d2a266d12
commit
13ee0a10ec
@ -301,6 +301,11 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
name = "model_" + name; // e.g. return => ModelReturn (after camelize)
|
||||
}
|
||||
|
||||
if (name.matches("^\\d.*")) {
|
||||
LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + camelize("model_" + name));
|
||||
name = "model_" + name; // e.g. 200Response => Model200Response (after camelize)
|
||||
}
|
||||
|
||||
// camelize the model name
|
||||
// phone_number => PhoneNumber
|
||||
return camelize(name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user