Fix composed oneof type 1749 (#1750)

* add test to check that DefaultCodegen generates composed oneof schema properly

* fix composed-oneof type generation bug (#1749)
This commit is contained in:
zigen 2018-12-24 18:46:42 +09:00 committed by William Cheng
parent 0dee995ebb
commit 7595baef00
2 changed files with 2 additions and 1 deletions

View File

@ -1413,8 +1413,8 @@ public class DefaultCodegen implements CodegenConfig {
// primitive type or model
names.add(getAlias(getPrimitiveType(s)));
}
return "oneOf<" + String.join(",", names) + ">";
}
return "oneOf<" + String.join(",", names) + ">";
}
}

View File

@ -252,6 +252,7 @@ public class DefaultCodegenTest {
String type = codegen.getSchemaType(schema);
Assert.assertNotNull(type);
Assert.assertEquals(type, "oneOf<ObjA,ObjB>");
}
@Test