diff --git a/src/test/scala/ModelPropertyParserTest.scala b/src/test/scala/ModelPropertyParserTest.scala index dd6539d6..256eb6f3 100644 --- a/src/test/scala/ModelPropertyParserTest.scala +++ b/src/test/scala/ModelPropertyParserTest.scala @@ -260,6 +260,23 @@ class ModelPropertyParserTest extends AnyFlatSpec with Matchers with OptionValue mapSchema.getAdditionalProperties shouldBe a[StringProperty] } + it should "process EchoList" in { + val converter = ModelConverters.getInstance() + val schemas = converter.readAll(classOf[EchoList]).asScala.toMap + val model = findModel(schemas, "EchoList") + model should be (defined) + model.value.getProperties should not be (null) + val val1Field = model.value.getProperties.get("val1") + val1Field shouldBe a [IntegerProperty] + val val1Schema = val1Field.asInstanceOf[IntegerProperty] + val1Schema.getRequired shouldBe true + val val2Field = model.value.getProperties.get("val2") + val2Field shouldBe a [IntegerProperty] + val val2Schema = val2Field.asInstanceOf[IntegerProperty] + val2Schema.getRequired shouldBe true + } + + private def findModel(schemas: Map[String, Model], name: String): Option[Model] = { schemas.get(name) match { case Some(m) => Some(m) diff --git a/src/test/scala/models/EchoList.scala b/src/test/scala/models/EchoList.scala new file mode 100644 index 00000000..a22a7110 --- /dev/null +++ b/src/test/scala/models/EchoList.scala @@ -0,0 +1,3 @@ +package models + +case class EchoList(val1: Int, val2: Int, val3: Int)