diff --git a/src/test/scala/com/github/swagger/scala/converter/ModelPropertyParserTest.scala b/src/test/scala/com/github/swagger/scala/converter/ModelPropertyParserTest.scala index bc30fa19..904f2006 100644 --- a/src/test/scala/com/github/swagger/scala/converter/ModelPropertyParserTest.scala +++ b/src/test/scala/com/github/swagger/scala/converter/ModelPropertyParserTest.scala @@ -337,6 +337,18 @@ class ModelPropertyParserTest extends AnyFlatSpec with Matchers with OptionValue nullSafeList(mapSchema.getRequired()) shouldBe empty } + 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 [IntegerSchema] + val val2Field = model.value.getProperties.get("val2") + val2Field shouldBe a [IntegerSchema] + } + private def findModel(schemas: Map[String, Schema[_]], name: String): Option[Schema[_]] = { 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..10afb437 --- /dev/null +++ b/src/test/scala/models/EchoList.scala @@ -0,0 +1,3 @@ +package models + +case class EchoList(val1: Int, val2: Int)