forked from loafle/openapi-generator-original
Swagger: AS3 sdk - fix to get models with wrapper names for list types
This commit is contained in:
@@ -30,7 +30,9 @@ public class FieldDefinition {
|
||||
private List<String> importDefinitions = new ArrayList<String>();
|
||||
|
||||
private String collectionItemType;
|
||||
|
||||
|
||||
private String collectionItemName;
|
||||
|
||||
public String getReturnType() {
|
||||
return returnType;
|
||||
}
|
||||
@@ -70,4 +72,12 @@ public class FieldDefinition {
|
||||
public String getCollectionItemType() {
|
||||
return collectionItemType;
|
||||
}
|
||||
|
||||
public String getCollectionItemName() {
|
||||
return collectionItemName;
|
||||
}
|
||||
|
||||
public void setCollectionItemName(String collectionItemName) {
|
||||
this.collectionItemName = collectionItemName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,8 +184,10 @@ public class ModelField {
|
||||
String entryType = type.substring(5, type.length()-1);
|
||||
if (dataTypeMapper.isPrimitiveType(entryType)) {
|
||||
fieldDefinition.setCollectionItemType(entryType);
|
||||
fieldDefinition.setCollectionItemName(entryType);
|
||||
} else {
|
||||
fieldDefinition.setCollectionItemType(config.getModelPackageName() + "." + nameGenerator.applyClassNamingPolicy(entryType));
|
||||
fieldDefinition.setCollectionItemName(nameGenerator.applyMethodNamingPolicy(entryType));
|
||||
}
|
||||
entryType = dataTypeMapper.getClassType(entryType, true);
|
||||
String returnType = dataTypeMapper.getListReturnTypeSignature(entryType);
|
||||
|
||||
Reference in New Issue
Block a user