mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 11:23:58 +00:00
Merge pull request #2284 from xhh/java-file-date-model-name-fix
[Java] Fix invalid imports when model name prefix/suffix is present
This commit is contained in:
commit
ea3232cb08
@ -83,6 +83,8 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
);
|
||||
instantiationTypes.put("array", "ArrayList");
|
||||
instantiationTypes.put("map", "HashMap");
|
||||
typeMapping.put("date", "Date");
|
||||
typeMapping.put("file", "File");
|
||||
|
||||
cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC));
|
||||
cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC));
|
||||
@ -488,7 +490,8 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
if (typeMapping.containsKey(swaggerType)) {
|
||||
type = typeMapping.get(swaggerType);
|
||||
if (languageSpecificPrimitives.contains(type) || type.indexOf(".") >= 0 ||
|
||||
type.equals("Map") || type.equals("List")) {
|
||||
type.equals("Map") || type.equals("List") ||
|
||||
type.equals("File") || type.equals("Date")) {
|
||||
return type;
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user