diff --git a/CHANGELOG.md b/CHANGELOG.md index af0b7e5fde..e589ceb449 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,9 @@ ### 0.27.3 +* `TelegramBotAPI`: + * Currently `UpdateDeserializationStrategy` is publicly available + ### 0.27.2 * `Common`: diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/abstracts/Update.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/abstracts/Update.kt index fa2129f854..874d3860fc 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/abstracts/Update.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/abstracts/Update.kt @@ -26,7 +26,14 @@ internal object UpdateSerializerWithoutSerialization : KSerializer { override fun serialize(encoder: Encoder, value: Update) = throw UnsupportedOperationException() } -internal object UpdateDeserializationStrategy : DeserializationStrategy { +/** + * Use this object to deserialize objects with type [Update]. Currently it is restricted to use this + * [DeserializationStrategy] only with JSON + * + * @see StringFormat.parse + * @see kotlinx.serialization.json.Json.parse + */ +object UpdateDeserializationStrategy : DeserializationStrategy { override val descriptor: SerialDescriptor = JsonElementSerializer.descriptor override fun patch(decoder: Decoder, old: Update): Update = throw UpdateNotSupportedException("Update")