mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-21 08:07:16 +00:00
update exposed and adapt to new version of kotlin serialization
This commit is contained in:
parent
d45aef9fe5
commit
f4ee6c2890
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,4 +12,5 @@ out/
|
||||
secret.gradle
|
||||
local.properties
|
||||
|
||||
|
||||
publishing.sh
|
||||
|
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,5 +1,15 @@
|
||||
# Changelog
|
||||
|
||||
## 0.9.0
|
||||
|
||||
* `Versions`:
|
||||
* `Kotlin`: `1.5.31` -> `1.6.10`
|
||||
* `Coroutines`: `1.5.2` -> `1.6.0`
|
||||
* `Serialization`: `1.3.1` -> `1.3.2`
|
||||
* `Exposed`: `0.36.2` -> `0.37.2`
|
||||
* `Ktor`: `1.6.5` -> `1.6.7`
|
||||
* `Klock`: `2.4.8` -> `2.4.10`
|
||||
|
||||
## 0.8.9
|
||||
|
||||
* `Ktor`:
|
||||
|
@ -32,8 +32,7 @@ class EitherSerializer<T1, T2>(
|
||||
t1Serializer: KSerializer<T1>,
|
||||
t2Serializer: KSerializer<T2>,
|
||||
) : KSerializer<Either<T1, T2>> {
|
||||
@ExperimentalSerializationApi
|
||||
@InternalSerializationApi
|
||||
@OptIn(ExperimentalSerializationApi::class, InternalSerializationApi::class)
|
||||
override val descriptor: SerialDescriptor = buildSerialDescriptor(
|
||||
"TypedSerializer",
|
||||
SerialKind.CONTEXTUAL
|
||||
@ -44,8 +43,7 @@ class EitherSerializer<T1, T2>(
|
||||
private val t1EitherSerializer = EitherFirst.serializer(t1Serializer, t2Serializer)
|
||||
private val t2EitherSerializer = EitherSecond.serializer(t1Serializer, t2Serializer)
|
||||
|
||||
@ExperimentalSerializationApi
|
||||
@InternalSerializationApi
|
||||
@OptIn(ExperimentalSerializationApi::class, InternalSerializationApi::class)
|
||||
override fun deserialize(decoder: Decoder): Either<T1, T2> {
|
||||
return decoder.decodeStructure(descriptor) {
|
||||
var type: String? = null
|
||||
@ -77,8 +75,7 @@ class EitherSerializer<T1, T2>(
|
||||
}
|
||||
|
||||
|
||||
@ExperimentalSerializationApi
|
||||
@InternalSerializationApi
|
||||
@OptIn(ExperimentalSerializationApi::class, InternalSerializationApi::class)
|
||||
override fun serialize(encoder: Encoder, value: Either<T1, T2>) {
|
||||
encoder.encodeStructure(descriptor) {
|
||||
when (value) {
|
||||
|
@ -10,7 +10,7 @@ org.gradle.jvmargs=-Xmx2g
|
||||
kotlin_version=1.6.10
|
||||
kotlin_coroutines_version=1.6.0
|
||||
kotlin_serialisation_core_version=1.3.2
|
||||
kotlin_exposed_version=0.37.1
|
||||
kotlin_exposed_version=0.37.2
|
||||
|
||||
ktor_version=1.6.7
|
||||
|
||||
|
@ -11,8 +11,7 @@ open class TypedSerializer<T : Any>(
|
||||
presetSerializers: Map<String, KSerializer<out T>> = emptyMap(),
|
||||
) : KSerializer<T> {
|
||||
protected val serializers = presetSerializers.toMutableMap()
|
||||
@ExperimentalSerializationApi
|
||||
@InternalSerializationApi
|
||||
@OptIn(InternalSerializationApi::class)
|
||||
override val descriptor: SerialDescriptor = buildSerialDescriptor(
|
||||
"TypedSerializer",
|
||||
SerialKind.CONTEXTUAL
|
||||
@ -21,8 +20,7 @@ open class TypedSerializer<T : Any>(
|
||||
element("value", ContextualSerializer(kClass).descriptor)
|
||||
}
|
||||
|
||||
@ExperimentalSerializationApi
|
||||
@InternalSerializationApi
|
||||
@OptIn(ExperimentalSerializationApi::class, InternalSerializationApi::class)
|
||||
override fun deserialize(decoder: Decoder): T {
|
||||
return decoder.decodeStructure(descriptor) {
|
||||
var type: String? = null
|
||||
@ -46,14 +44,12 @@ open class TypedSerializer<T : Any>(
|
||||
}
|
||||
}
|
||||
|
||||
@ExperimentalSerializationApi
|
||||
@InternalSerializationApi
|
||||
@OptIn(ExperimentalSerializationApi::class, InternalSerializationApi::class)
|
||||
protected open fun <O: T> CompositeEncoder.encode(value: O) {
|
||||
encodeSerializableElement(descriptor, 1, value::class.serializer() as KSerializer<O>, value)
|
||||
}
|
||||
|
||||
@ExperimentalSerializationApi
|
||||
@InternalSerializationApi
|
||||
@OptIn(ExperimentalSerializationApi::class, InternalSerializationApi::class)
|
||||
override fun serialize(encoder: Encoder, value: T) {
|
||||
encoder.encodeStructure(descriptor) {
|
||||
val valueSerializer = value::class.serializer()
|
||||
|
Loading…
Reference in New Issue
Block a user