mirror of
https://github.com/InsanusMokrassar/SDI.git
synced 2024-11-27 04:28:53 +00:00
ModuleSerializer now can be instantiated automatically
This commit is contained in:
parent
c8cae5c941
commit
dbd9c1b484
@ -3,6 +3,8 @@
|
||||
## 0.4.1
|
||||
|
||||
* `Serialization`: `1.1.0-RC` -> `1.1.0`
|
||||
* `ModuleSerializer` now can be instantiated automatically
|
||||
|
||||
|
||||
## 0.4.0
|
||||
|
||||
|
@ -94,9 +94,16 @@ internal data class SerializationContext(
|
||||
|
||||
@Serializer(Module::class)
|
||||
class ModuleSerializer(
|
||||
private val moduleBuilder: (SerializersModuleBuilder.() -> Unit)? = null,
|
||||
private vararg val additionalClassesToInclude: KClass<*>
|
||||
private val additionalClassesToInclude: Iterable<KClass<*>>,
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user