File tree Expand file tree Collapse file tree 4 files changed +28
-3
lines changed
main/scala-2/com/github/swagger/scala/converter
com/github/swagger/scala/converter Expand file tree Collapse file tree 4 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 1- addSbtPlugin(" org.scoverage" % " sbt-scoverage" % " 2.0.5 " )
1+ addSbtPlugin(" org.scoverage" % " sbt-scoverage" % " 2.0.4 " )
22
33addSbtPlugin(" org.typelevel" % " sbt-typelevel-sonatype-ci-release" % " 0.5.0-M5" )
44
Original file line number Diff line number Diff line change @@ -42,7 +42,16 @@ private[converter] object ErasureHelper {
4242 // use this form because of Scala 2.11 & 2.12 compile issue
4343 logger.debug(s " Unable to get type info ${Option (cls.getName).getOrElse(" null" )}" , t)
4444 } else {
45- logger.info(" Unable to get type info {}" , Option (cls.getName).getOrElse(" null" ))
45+ logger.info(s " Unable to get type info ${Option (cls.getName).getOrElse(" null" )}: $t" )
46+ }
47+ Map .empty[String , Class [_]]
48+ }
49+ case err : NoClassDefFoundError => {
50+ if (logger.isDebugEnabled) {
51+ // use this form because of Scala 2.11 & 2.12 compile issue
52+ logger.debug(s " Unable to get type info ${Option (cls.getName).getOrElse(" null" )}" , err)
53+ } else {
54+ logger.info(s " Unable to get type info ${Option (cls.getName).getOrElse(" null" )}: $err" )
4655 }
4756 Map .empty[String , Class [_]]
4857 }
Original file line number Diff line number Diff line change @@ -570,12 +570,19 @@ class ModelPropertyParserTest extends AnyFlatSpec with BeforeAndAfterEach with M
570570 }
571571
572572 it should " process case class with Duration field" in new PropertiesScope [ModelWDuration ] {
573- model.value.getRequired.asScala shouldEqual Seq (" duration" )
573+ nullSafeSeq( model.value.getRequired) shouldEqual Seq (" duration" )
574574 val props = nullSafeMap(model.value.getProperties)
575575 props should have size 1
576576 props(" duration" ) shouldBe a[Schema [_]]
577577 }
578578
579+ it should " process DataExampleClass" in new PropertiesScope [DataExampleClass ] {
580+ nullSafeSeq(model.value.getRequired) shouldEqual Seq (" data" )
581+ val props = nullSafeMap(model.value.getProperties)
582+ props should have size 1
583+ props(" data" ) shouldBe a[Schema [_]]
584+ }
585+
579586 it should " process sealed abstract class" in new TestScope {
580587 val schemas = converter.readAll(classOf [Animal ]).asScala.toMap
581588 val catModel = findModel(schemas, " Cat" )
Original file line number Diff line number Diff line change 1+ package models
2+
3+ final case class DataExampleClass (data : CustomCollection [ExampleProperties ])
4+
5+ final case class CustomCollection [T ](features : Seq [FeatureExample [T ]])
6+
7+ final case class FeatureExample [T ](geometry : Option [T ])
8+
9+ final case class ExampleProperties (p1 : Int , p2 : Double )
You can’t perform that action at this time.
0 commit comments