Merge pull request #1807 from wing328/java_fix_import

[Java] To fix missing imports in inline models
This commit is contained in:
wing328
2016-01-05 11:45:50 +08:00
19 changed files with 25 additions and 23 deletions

View File

@@ -476,11 +476,13 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
model.imports.add("JsonSerialize");
}
}
if(model.isEnum == null || model.isEnum) {
// needed by all pojos, but not enums
model.imports.add("ApiModelProperty");
model.imports.add("ApiModel");
model.imports.add("Objects");
// comment out below as it's in the model template
//model.imports.add("Objects");
final String lib = getLibrary();
if(StringUtils.isEmpty(lib) || "feign".equals(lib) || "jersey2".equals(lib)) {