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 * @param name the name of the model
* @return capitalized model name * @return capitalized model name

View File

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

View File

@ -389,7 +389,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**pet_id** | **int**| ID of pet to update | **pet_id** | **int**| ID of pet to update |
**additional_metadata** | **string**| Additional data to pass to server | [optional] **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 ### Return type