Skip to content

Commit

Permalink
chore: ignore Json unknown keys when parsing Sync Info for compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellet committed Jul 6, 2024
1 parent 5c44400 commit 3019060
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package syncInfo.data

import kotlinx.serialization.json.Json
import okhttp3.OkHttpClient
import okhttp3.Request
import syncInfo.models.SyncInfo
import utils.JsonIgnoreUnknownKeys
import utils.executeAsync
import utils.getBodyOrThrow

Expand All @@ -29,7 +29,7 @@ class RemoteSyncInfoDataSource(
)
}
val responseBody: String = response.getBodyOrThrow().string()
val syncInfo = Json.decodeFromString<SyncInfo>(responseBody)
val syncInfo = JsonIgnoreUnknownKeys.decodeFromString<SyncInfo>(responseBody)
return Result.success(syncInfo)
} catch (e: Exception) {
return Result.failure(e)
Expand Down

0 comments on commit 3019060

Please sign in to comment.