forked from loafle/openapi-generator-original
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:
parent
0dee995ebb
commit
7595baef00
@ -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) + ">";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -252,6 +252,7 @@ public class DefaultCodegenTest {
|
||||
String type = codegen.getSchemaType(schema);
|
||||
|
||||
Assert.assertNotNull(type);
|
||||
Assert.assertEquals(type, "oneOf<ObjA,ObjB>");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user