mirror of
https://github.com/InsanusMokrassar/SDI.git
synced 2024-11-23 10:38:52 +00:00
fixes in ModuleSerializer
This commit is contained in:
parent
6de0f26190
commit
d55a8495da
@ -97,12 +97,6 @@ class ModuleSerializer(
|
||||
private val additionalClassesToInclude: Iterable<KClass<*>> = emptyList(),
|
||||
private val moduleBuilder: (SerializersModuleBuilder.() -> Unit)? = null
|
||||
) : KSerializer<Module> {
|
||||
constructor() : this(emptyList()) // to be able to create default instance
|
||||
|
||||
constructor(
|
||||
moduleBuilder: (SerializersModuleBuilder.() -> Unit)? = null,
|
||||
vararg additionalClassesToInclude: KClass<*>,
|
||||
) : this(additionalClassesToInclude.toList(), moduleBuilder)
|
||||
|
||||
private val jsonObjectSerializer = JsonObject.serializer()
|
||||
override val descriptor: SerialDescriptor = jsonObjectSerializer.descriptor
|
||||
@ -160,4 +154,9 @@ class ModuleSerializer(
|
||||
}
|
||||
}
|
||||
|
||||
fun ModuleSerializer(
|
||||
moduleBuilder: (SerializersModuleBuilder.() -> Unit)? = null,
|
||||
vararg additionalClassesToInclude: KClass<*>
|
||||
) = ModuleSerializer(additionalClassesToInclude.toList(), moduleBuilder)
|
||||
|
||||
val DefaultModuleSerializer = ModuleSerializer()
|
||||
|
Loading…
Reference in New Issue
Block a user