From e303a43d36dacc218caae9baea1c8449f758d451 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 20 Mar 2019 08:55:46 +0800 Subject: [PATCH] complete ImplicitReflectionSerializer removing --- CHANGELOG.md | 1 + .../requests/common/CommonMultipartFileRequest.kt | 1 - .../requests/send/media/base/MultipartRequestImpl.kt | 1 - .../github/insanusmokrassar/TelegramBotAPI/utils/JSON.kt | 6 ------ 4 files changed, 1 insertion(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 326a5160f4..0ce86e956b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ for receivers. ### 0.12.3 Cleaning * Refactor, optimizing and cleaning of code +* Removed deprecated method `T#toJsonWithoutNulls()` ## 0.11.0 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/common/CommonMultipartFileRequest.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/common/CommonMultipartFileRequest.kt index efa5240cbd..eb3c012b2f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/common/CommonMultipartFileRequest.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/common/CommonMultipartFileRequest.kt @@ -8,6 +8,5 @@ data class CommonMultipartFileRequest( val data: Request, override val mediaMap: Map ) : MultipartRequest, Request by data { - @ImplicitReflectionSerializer override val paramsJson: JsonObject = data.json() } diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/base/MultipartRequestImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/base/MultipartRequestImpl.kt index bc5488a504..c52e68181f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/base/MultipartRequestImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/base/MultipartRequestImpl.kt @@ -15,7 +15,6 @@ class MultipartRequestImpl, F: Files, R: Any>( ) : MultipartRequest { override fun method(): String = data.method() override fun resultSerializer(): KSerializer = data.resultSerializer() - @ImplicitReflectionSerializer override val paramsJson: JsonObject = data.json() override val mediaMap: Map = files } diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/JSON.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/JSON.kt index e8c0583fac..bd571eed1f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/JSON.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/JSON.kt @@ -4,12 +4,6 @@ import kotlinx.serialization.ImplicitReflectionSerializer import kotlinx.serialization.KSerializer import kotlinx.serialization.json.* -@Deprecated("This method can throw exceptions") -@ImplicitReflectionSerializer -inline fun T.toJsonWithoutNulls(): JsonObject = Json.nonstrict.toJson( - this -).jsonObject.withoutNulls() - inline fun T.toJsonWithoutNulls(serializer: KSerializer): JsonObject = toJson(serializer).withoutNulls() inline fun T.toJson(serializer: KSerializer): JsonObject = Json.nonstrict.toJson(