Merge pull request #9 from InsanusMokrassar/0.4.1

0.4.1
This commit is contained in:
InsanusMokrassar 2021-02-22 19:11:59 +06:00 committed by GitHub
commit 025191ba61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 4 deletions

View File

@ -1,5 +1,11 @@
# SDI changelogs # SDI changelogs
## 0.4.1
* `Serialization`: `1.1.0-RC` -> `1.1.0`
* `ModuleSerializer` now can be instantiated automatically
## 0.4.0 ## 0.4.0
* Fix of [#6](https://github.com/InsanusMokrassar/SDI/issues/6) * Fix of [#6](https://github.com/InsanusMokrassar/SDI/issues/6)

View File

@ -3,10 +3,10 @@ org.gradle.parallel=true
kotlin.incremental.multiplatform=true kotlin.incremental.multiplatform=true
kotlin_version=1.4.30 kotlin_version=1.4.30
kotlin_serialisation_runtime_version=1.1.0-RC kotlin_serialisation_runtime_version=1.1.0
klassindex_version=4.1.0-rc.1 klassindex_version=4.1.0-rc.1
github_release_plugin_version=2.2.12 github_release_plugin_version=2.2.12
group=dev.inmo group=dev.inmo
version=0.4.0 version=0.4.1

View File

@ -94,9 +94,16 @@ internal data class SerializationContext(
@Serializer(Module::class) @Serializer(Module::class)
class ModuleSerializer( class ModuleSerializer(
private val moduleBuilder: (SerializersModuleBuilder.() -> Unit)? = null, private val additionalClassesToInclude: Iterable<KClass<*>>,
private vararg val additionalClassesToInclude: KClass<*> private val moduleBuilder: (SerializersModuleBuilder.() -> Unit)? = null
) : KSerializer<Module> { ) : 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() private val jsonObjectSerializer = JsonObject.serializer()
override val descriptor: SerialDescriptor = jsonObjectSerializer.descriptor override val descriptor: SerialDescriptor = jsonObjectSerializer.descriptor