forked from loafle/openapi-generator-original
added ignored test for #453, nested containers
This commit is contained in:
parent
5b01e78a72
commit
23e848b437
@ -124,6 +124,37 @@ class JavaModelTest extends FlatSpec with Matchers {
|
|||||||
vars.get(0).isContainer should equal (true)
|
vars.get(0).isContainer should equal (true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ignore should "convert a model with a map with complex list property" in {
|
||||||
|
val model = new ModelImpl()
|
||||||
|
.description("a sample model")
|
||||||
|
.property("translations", new MapProperty()
|
||||||
|
.additionalProperties(
|
||||||
|
new ArrayProperty().items(new RefProperty("Pet")))
|
||||||
|
)
|
||||||
|
.required("id")
|
||||||
|
|
||||||
|
val codegen = new JavaClientCodegen()
|
||||||
|
val cm = codegen.fromModel("sample", model)
|
||||||
|
|
||||||
|
cm.name should be ("sample")
|
||||||
|
cm.classname should be ("Sample")
|
||||||
|
cm.description should be ("a sample model")
|
||||||
|
cm.vars.size should be (1)
|
||||||
|
|
||||||
|
val vars = cm.vars
|
||||||
|
vars.get(0).baseName should be ("translations")
|
||||||
|
vars.get(0).getter should be ("getTranslations")
|
||||||
|
vars.get(0).setter should be ("setTranslations")
|
||||||
|
vars.get(0).datatype should be ("Map<String, List<Pet>>")
|
||||||
|
vars.get(0).name should be ("translations")
|
||||||
|
vars.get(0).defaultValue should be ("new HashMap<String, List<Pet>>() ")
|
||||||
|
vars.get(0).baseType should be ("Map")
|
||||||
|
vars.get(0).containerType should be ("map")
|
||||||
|
vars.get(0).required should equal (false)
|
||||||
|
vars.get(0).isContainer should equal (true)
|
||||||
|
}
|
||||||
|
|
||||||
it should "convert a model with complex properties" in {
|
it should "convert a model with complex properties" in {
|
||||||
val model = new ModelImpl()
|
val model = new ModelImpl()
|
||||||
.description("a sample model")
|
.description("a sample model")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user