@@ -293,6 +293,34 @@ class ModelPropertyParserTest extends AnyFlatSpec with Matchers with OptionValue
293293 nullSafeList(arraySchema.getRequired()) shouldBe empty
294294 }
295295
296+ it should " process Model with Scala Map" in {
297+ val converter = ModelConverters .getInstance()
298+ val schemas = converter.readAll(classOf [ModelWMapString ]).asScala.toMap
299+ val model = findModel(schemas, " ModelWMapString" )
300+ model should be (defined)
301+ model.value.getProperties should not be (null )
302+ val stringsField = model.value.getProperties.get(" strings" )
303+ stringsField shouldBe a [MapSchema ]
304+ val mapSchema = stringsField.asInstanceOf [MapSchema ]
305+ mapSchema.getUniqueItems() shouldBe (null )
306+ nullSafeMap(mapSchema.getProperties()) shouldBe empty
307+ nullSafeList(mapSchema.getRequired()) shouldBe empty
308+ }
309+
310+ it should " process Model with Java Map" in {
311+ val converter = ModelConverters .getInstance()
312+ val schemas = converter.readAll(classOf [ModelWJavaMapString ]).asScala.toMap
313+ val model = findModel(schemas, " ModelWJavaMapString" )
314+ model should be (defined)
315+ model.value.getProperties should not be (null )
316+ val stringsField = model.value.getProperties.get(" strings" )
317+ stringsField shouldBe a [MapSchema ]
318+ val mapSchema = stringsField.asInstanceOf [MapSchema ]
319+ mapSchema.getUniqueItems() shouldBe (null )
320+ nullSafeMap(mapSchema.getProperties()) shouldBe empty
321+ nullSafeList(mapSchema.getRequired()) shouldBe empty
322+ }
323+
296324 private def findModel (schemas : Map [String , Schema [_]], name : String ): Option [Schema [_]] = {
297325 schemas.get(name) match {
298326 case Some (m) => Some (m)
0 commit comments