Skip to content

Commit 37b18ad

Browse files
committed
fix test issue
1 parent e6bef26 commit 37b18ad

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
com.github.swagger.scala3enum.converter.SwaggerScala3EnumModelConverter

src/main/resources/META_INF/services/io.swagger.v3.core.converter.ModelConverter

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.swagger.scala3.`enum`.converter
1+
package com.github.swagger.scala3enum.converter
22

33
import com.github.swagger.scala.converter.AnnotatedTypeForOption
44
import io.swagger.v3.core.converter.{AnnotatedType, ModelConverter, ModelConverterContext}
@@ -69,7 +69,7 @@ class SwaggerScala3EnumModelConverter extends ModelResolver(Json.mapper()) {
6969
val enumArray = enumCompanion.getClass.getDeclaredMethod("values").invoke(enumCompanion).asInstanceOf[Array[Enum]]
7070
enumArray.sortBy(_.ordinal).map(_.toString).toSeq
7171
}
72-
72+
7373
private def setRequired(annotatedType: AnnotatedType): Unit = annotatedType match {
7474
case _: AnnotatedTypeForOption => // not required
7575
case _ => {

src/test/scala/com/github/swagger/scala3/enum/converter/Car.scala

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/test/scala/com/github/swagger/scala3/enum/converter/ColorEnum.scala

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package com.github.swagger.scala3enum.converter
2+
3+
case class Car(make: String, color: ColorEnum)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package com.github.swagger.scala3enum.converter
2+
3+
enum ColorEnum { case Red, Green, Blue }
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.swagger.scala3.`enum`.converter
1+
package com.github.swagger.scala3enum.converter
22

33
import io.swagger.v3.core.converter.ModelConverters
44
import io.swagger.v3.oas.models.media.{Schema, StringSchema}
@@ -26,8 +26,8 @@ class SwaggerScala3EnumModelConverterSpec extends AnyWordSpec with Matchers with
2626
model.get.getProperties should not be (null)
2727
val field = model.value.getProperties.get("color")
2828
field shouldBe a [StringSchema]
29-
field.asInstanceOf[StringSchema].getEnum.asScala shouldEqual Seq("Red")
30-
nullSafeList(model.value.getRequired) shouldBe Seq("color")
29+
field.asInstanceOf[StringSchema].getEnum.asScala shouldEqual Seq("Red", "Green", "Blue")
30+
nullSafeList(model.value.getRequired) shouldBe Seq("color", "make")
3131
}
3232
}
3333

0 commit comments

Comments
 (0)