File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
com/github/swagger/scala/converter Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,18 @@ class ModelPropertyParserTest extends FlatSpec with Matchers {
134134 nullSafeList(model.get.getRequired) shouldBe empty
135135 }
136136
137+ it should " process Model with Scala Option Boolean with Schema Override" in {
138+ val converter = ModelConverters .getInstance()
139+ val schemas = converter.readAll(classOf [ModelWOptionBooleanSchemaOverride ]).asScala.toMap
140+ val model = schemas.get(" ModelWOptionBooleanSchemaOverride" )
141+ model should be (' defined )
142+ model.get.getProperties should not be (null )
143+ val optBoolean = model.get.getProperties().get(" optBoolean" )
144+ optBoolean should not be (null )
145+ optBoolean shouldBe a [BooleanSchema ]
146+ nullSafeList(model.get.getRequired) shouldBe empty
147+ }
148+
137149 it should " process all properties as required barring Option[_] or if overridden in annotation" in {
138150 val schemas = ModelConverters
139151 .getInstance()
Original file line number Diff line number Diff line change 11package models
22
3+ import io .swagger .v3 .oas .annotations .media .Schema
4+
35case class ModelWOptionBoolean (optBoolean : Option [Boolean ])
6+
7+ case class ModelWOptionBooleanSchemaOverride (@ Schema (implementation = classOf [Boolean ]) optBoolean : Option [Boolean ])
You can’t perform that action at this time.
0 commit comments