diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bd72d8e75..e7ea38cb3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,11 @@ ### 0.28.3 +* Common`: + * Version updates: + * `Klock`: `0.12.0` -> `0.12.1` + * `Kotlin serialization`: `1.0.0-RC` -> `1.0.0-RC2` (dependency `kotlinx-serialization-core` was replaced with + `kotlinx-serialization-json` due to [kotlinx.serialization library update](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md#100-rc2--2020-09-21)) * `TelegramBotAPI-core`: * All `InlineQueryResult` has changed their type of id for more obvious relation between `InlineQueryResult#id` and `ChosenInlineResult#resultId`: `String` -> `InlineQueryIdentifier` diff --git a/TelegramBotAPI-core/build.gradle b/TelegramBotAPI-core/build.gradle index 19420bf448..eaf93b61f8 100644 --- a/TelegramBotAPI-core/build.gradle +++ b/TelegramBotAPI-core/build.gradle @@ -41,7 +41,7 @@ kotlin { dependencies { implementation kotlin('stdlib') api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" - api "org.jetbrains.kotlinx:kotlinx-serialization-core:$kotlin_serialisation_runtime_version" + api "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialisation_runtime_version" api "org.jetbrains.kotlinx:kotlinx-serialization-properties:$kotlin_serialisation_runtime_version" api "com.soywiz.korlibs.klock:klock:$klock_version" diff --git a/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/JSON.kt b/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/JSON.kt index 01c3d0f8b5..1a4e506d12 100644 --- a/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/JSON.kt +++ b/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/JSON.kt @@ -8,6 +8,7 @@ internal val nonstrictJsonFormat = Json { ignoreUnknownKeys = true allowSpecialFloatingPointValues = true useArrayPolymorphism = true + encodeDefaults = true } fun T.toJsonWithoutNulls(serializer: SerializationStrategy): JsonObject = toJson(serializer).withoutNulls() diff --git a/TelegramBotAPI-core/src/commonTest/kotlin/com/github/insanusmokrassar/TelegramBotAPI/SimpleInputFilesTest.kt b/TelegramBotAPI-core/src/commonTest/kotlin/com/github/insanusmokrassar/TelegramBotAPI/SimpleInputFilesTest.kt index 1da2a34a55..22294176ea 100644 --- a/TelegramBotAPI-core/src/commonTest/kotlin/com/github/insanusmokrassar/TelegramBotAPI/SimpleInputFilesTest.kt +++ b/TelegramBotAPI-core/src/commonTest/kotlin/com/github/insanusmokrassar/TelegramBotAPI/SimpleInputFilesTest.kt @@ -13,6 +13,7 @@ private val nonstrictJsonFormat = Json { ignoreUnknownKeys = true allowSpecialFloatingPointValues = true useArrayPolymorphism = true + encodeDefaults = true } class SimpleInputFilesTest { diff --git a/TelegramBotAPI-core/src/commonTest/kotlin/com/github/insanusmokrassar/TelegramBotAPI/TestsJsonFormat.kt b/TelegramBotAPI-core/src/commonTest/kotlin/com/github/insanusmokrassar/TelegramBotAPI/TestsJsonFormat.kt index c027bfd689..913df02bde 100644 --- a/TelegramBotAPI-core/src/commonTest/kotlin/com/github/insanusmokrassar/TelegramBotAPI/TestsJsonFormat.kt +++ b/TelegramBotAPI-core/src/commonTest/kotlin/com/github/insanusmokrassar/TelegramBotAPI/TestsJsonFormat.kt @@ -2,4 +2,6 @@ package com.github.insanusmokrassar.TelegramBotAPI import kotlinx.serialization.json.Json -val TestsJsonFormat = Json {} +val TestsJsonFormat = Json { + encodeDefaults = true +} diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/JsonUtils.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/JsonUtils.kt index 0a4153f2c1..2ae50a6cdb 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/JsonUtils.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/JsonUtils.kt @@ -8,4 +8,5 @@ internal val nonstrictJsonFormat = Json { ignoreUnknownKeys = true allowSpecialFloatingPointValues = true useArrayPolymorphism = true + encodeDefaults = true } diff --git a/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/JsonFormat.kt b/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/JsonFormat.kt index 86b3f21720..76b4a1d614 100644 --- a/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/JsonFormat.kt +++ b/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/JsonFormat.kt @@ -8,4 +8,5 @@ internal val nonstrictJsonFormat = Json { ignoreUnknownKeys = true allowSpecialFloatingPointValues = true useArrayPolymorphism = true + encodeDefaults = true } diff --git a/gradle.properties b/gradle.properties index 89d3e9ce4e..f6c24eaf52 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,8 +7,8 @@ kotlin.incremental.js=true kotlin_version=1.4.10 kotlin_coroutines_version=1.3.9 -kotlin_serialisation_runtime_version=1.0.0-RC -klock_version=1.12.0 +kotlin_serialisation_runtime_version=1.0.0-RC2 +klock_version=1.12.1 uuid_version=0.2.2 ktor_version=1.4.0