UpdateDeserializationStrategy currently is public

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

No files matched your search

+3
View File
@@ -51,6 +51,9 @@
### 0.27.3
* `TelegramBotAPI`:
* Currently `UpdateDeserializationStrategy` is publicly available
### 0.27.2
* `Common`:
@@ -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")