add schema mapping support to perl (#12991)

This commit is contained in:
William Cheng 2022-07-23 08:56:47 +08:00 committed by GitHub
parent 219b32b543
commit 00ef7a8590
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -334,6 +334,12 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig {
@Override @Override
public String toModelName(String name) { public String toModelName(String name) {
// We need to check if schema-mapping has a different model for this class, so we use it
// instead of the auto-generated one.
if (schemaMapping.containsKey(name)) {
return schemaMapping.get(name);
}
name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
// model name cannot use reserved keyword // model name cannot use reserved keyword