Skip to content

Commit a8b8d9b

Browse files
committed
[issue-9926] add parentContainer property to CodegenModel
1 parent f1569a0 commit a8b8d9b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public class CodegenModel {
4040

4141
public Set<String> imports = new TreeSet<String>();
4242
public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasRequired, hasOptional, isArrayModel, hasChildren;
43+
public CodegenProperty parentContainer;
4344
public boolean hasOnlyReadOnly = true; // true if all properties are read-only
4445
public ExternalDocs externalDocs;
4546

modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,6 +1705,7 @@ public CodegenProperty fromProperty(String name, Property p) {
17051705
if (p instanceof IntegerProperty) {
17061706
IntegerProperty sp = (IntegerProperty) p;
17071707
property.isInteger = true;
1708+
property.isNumeric = true;
17081709
if (sp.getEnum() != null) {
17091710
List<Integer> _enum = sp.getEnum();
17101711
property._enum = new ArrayList<String>();
@@ -3079,10 +3080,10 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera
30793080
}
30803081

30813082
private void addParentContainer(CodegenModel m, String name, Property property) {
3082-
final CodegenProperty tmp = fromProperty(name, property);
3083-
addImport(m, tmp.complexType);
3083+
m.parentContainer = fromProperty(name, property);
3084+
addImport(m, m.parentContainer.complexType);
30843085
m.parent = toInstantiationType(property);
3085-
final String containerType = tmp.containerType;
3086+
final String containerType = m.parentContainer.containerType;
30863087
final String instantiationType = instantiationTypes.get(containerType);
30873088
if (instantiationType != null) {
30883089
addImport(m, instantiationType);

0 commit comments

Comments
 (0)