File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
main/kotlin/com/papsign/ktor/openapigen/schema/builder/provider Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import kotlin.reflect.jvm.jvmErasure
13
13
object DefaultEnumSchemaProvider: SchemaBuilderProviderModule, OpenAPIGenModuleExtension {
14
14
15
15
private object Builder: SchemaBuilder {
16
- override val superType: KType = getKType<Enum <* >>()
16
+ override val superType: KType = getKType<Enum <* >? > ()
17
17
18
18
override fun build (
19
19
type : KType ,
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ class GeneralBehaviorTest {
46
46
assert (! getKType<FloatArray >().isSubtypeOf(getKType<Array <Any >>()))
47
47
assert (! getKType<Array <Any >>().isSubtypeOf(getKType<Iterable <Any >>()))
48
48
assert (getKType<List <Any >>().isSubtypeOf(getKType<Iterable <Any >>()))
49
+ assert (getKType<List <Any >>().isSubtypeOf(getKType<Iterable <Any ?>>()))
49
50
}
50
51
51
52
@Test
@@ -60,4 +61,19 @@ class GeneralBehaviorTest {
60
61
fun testEnumSubtypes () {
61
62
assert (getKType<TestEnum >().isSubtypeOf(getKType<Enum <* >>()))
62
63
}
64
+
65
+
66
+ lateinit var nothing: Nothing
67
+ val nullableNothing: Nothing? = null
68
+
69
+ val nothingType = ::nothing.returnType
70
+ val nullNothingType = ::nullableNothing.returnType
71
+
72
+ @Test
73
+ fun testNothingSubtypes () {
74
+ println (nothingType)
75
+ println (nullNothingType)
76
+ assert (nothingType.isSubtypeOf(nullNothingType))
77
+ assert (! nullNothingType.isSubtypeOf(nothingType))
78
+ }
63
79
}
You can’t perform that action at this time.
0 commit comments