Merge branch 'd0x-Ignore_Javatypes_On_ModelPre_and_Suffixes'

This commit is contained in:
wing328 2016-12-20 17:47:03 +08:00
commit c4ccf49064
3 changed files with 9 additions and 13 deletions

View File

@ -1193,7 +1193,8 @@ public class DefaultCodegen {
}
/**
* Output the proper model name (capitalized)
* Output the proper model name (capitalized).
* In case the name belongs to the TypeSystem it won't be renamed.
*
* @param name the name of the model
* @return capitalized model name

View File

@ -619,21 +619,16 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
@Override
public String getSwaggerType(Property p) {
String swaggerType = super.getSwaggerType(p);
String type;
// don't apply renaming on types from the typeMapping
if (typeMapping.containsKey(swaggerType)) {
type = typeMapping.get(swaggerType);
if (languageSpecificPrimitives.contains(type) || type.indexOf(".") >= 0 ||
type.equals("Map") || type.equals("List") ||
type.equals("File") || type.equals("Date")) {
return type;
return typeMapping.get(swaggerType);
}
} else {
type = swaggerType;
}
if (null == type) {
if (null == swaggerType) {
LOGGER.error("No Type defined for Property " + p);
}
return toModelName(type);
return toModelName(swaggerType);
}
@Override

View File

@ -389,7 +389,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet_id** | **int**| ID of pet to update |
**additional_metadata** | **string**| Additional data to pass to server | [optional]
**file** | **\SplFileObject**| file to upload | [optional]
**file** | **\SplFileObject****\SplFileObject**| file to upload | [optional]
### Return type