Skip to content

Commit d79fe21

Browse files
committed
fixed flow handling in generator because it was actually camelCase on purpose, so it could be used as map keys.
stupid inconsistent standards...
1 parent 712e63e commit d79fe21

File tree

1 file changed

+4
-6
lines changed
  • src/main/kotlin/com/papsign/ktor/openapigen/openapi

1 file changed

+4
-6
lines changed

src/main/kotlin/com/papsign/ktor/openapigen/openapi/Flows.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package com.papsign.ktor.openapigen.openapi
33
import java.util.*
44
import kotlin.reflect.KProperty
55

6-
class Flows<T>: MutableMap<Flows.FlowType, Flows.Flow<T>> by EnumMap(FlowType::class.java)
6+
class Flows<T>: MutableMap<String, Flows.Flow<T>> by HashMap<String, Flow<T>>()
77
where T : Enum<T>, T : Described {
88

99
private var implicit: Flow<T>? by this
@@ -53,16 +53,14 @@ class Flows<T>: MutableMap<Flows.FlowType, Flows.Flow<T>> by EnumMap(FlowType::c
5353
}
5454

5555
private operator fun setValue(any: Any, property: KProperty<*>, any1: Flow<T>?) {
56-
val type = FlowType.valueOf(property.name)
5756
if (any1 == null)
58-
this.remove(type)
57+
this.remove(property.name)
5958
else
60-
this[type] = any1
59+
this[property.name] = any1
6160
}
6261

6362
private operator fun getValue(any: Any, property: KProperty<*>): Flow<T>? {
64-
val type = FlowType.valueOf(property.name)
65-
return this[type]
63+
return this[property.name]
6664
}
6765

6866
companion object {

0 commit comments

Comments
 (0)