2208 fix Objc Mapping Generation (#3894)

* Change test to test valid compileable code. This is not a Objective-C Generic, but a protocol. This is what the JSONModel mapping library expects

* Update implementation to properly render NSDictionaries that will work with JSONModel
This commit is contained in:
ClayAtWork 2016-10-10 20:45:59 -07:00 committed by wing328
parent d48ce8b503
commit 504f8f1f21
2 changed files with 2 additions and 2 deletions

View File

@ -359,7 +359,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
return getSwaggerType(p) + "<NSString*, " + innerTypeDeclaration + "*>*"; return getSwaggerType(p) + "<NSString*, " + innerTypeDeclaration + "*>*";
} }
} }
return getSwaggerType(p) + "<NSString*, " + innerTypeDeclaration + ">*"; return getSwaggerType(p) + "<" + innerTypeDeclaration + ">*";
} }
} else { } else {
String swaggerType = getSwaggerType(p); String swaggerType = getSwaggerType(p);

View File

@ -224,7 +224,7 @@ public class ObjcModelTest {
final CodegenProperty property1 = cm.vars.get(0); final CodegenProperty property1 = cm.vars.get(0);
Assert.assertEquals(property1.baseName, "children"); Assert.assertEquals(property1.baseName, "children");
Assert.assertEquals(property1.complexType, "SWGChildren"); Assert.assertEquals(property1.complexType, "SWGChildren");
Assert.assertEquals(property1.datatype, "NSDictionary<NSString*, SWGChildren>*"); Assert.assertEquals(property1.datatype, "NSDictionary<SWGChildren>*");
Assert.assertEquals(property1.name, "children"); Assert.assertEquals(property1.name, "children");
Assert.assertEquals(property1.baseType, "NSDictionary"); Assert.assertEquals(property1.baseType, "NSDictionary");
Assert.assertEquals(property1.containerType, "map"); Assert.assertEquals(property1.containerType, "map");