1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-22 16:47:13 +00:00

UpdateDeserializationStrategy currently is public

This commit is contained in:
InsanusMokrassar 2020-05-13 19:53:27 +06:00
parent 01da98d2fe
commit 0de1d9cfda
2 changed files with 11 additions and 1 deletions

View File

@ -51,6 +51,9 @@
### 0.27.3
* `TelegramBotAPI`:
* Currently `UpdateDeserializationStrategy` is publicly available
### 0.27.2
* `Common`:

View File

@ -26,7 +26,14 @@ internal object UpdateSerializerWithoutSerialization : KSerializer<Update> {
override fun serialize(encoder: Encoder, value: Update) = throw UnsupportedOperationException()
}
internal object UpdateDeserializationStrategy : DeserializationStrategy<Update> {
/**
* 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<Update> {
override val descriptor: SerialDescriptor = JsonElementSerializer.descriptor
override fun patch(decoder: Decoder, old: Update): Update = throw UpdateNotSupportedException("Update")