mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 10:37:05 +05:30
all: allow unknown keys in responses
This commit is contained in:
parent
b5c2dc9aaf
commit
6eb3acff78
3 changed files with 12 additions and 3 deletions
|
@ -9,6 +9,8 @@ import retrofit2.create
|
|||
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
class Api {
|
||||
private val json = Json { ignoreUnknownKeys = true }
|
||||
|
||||
private fun getOkHttpClient(): OkHttpClient {
|
||||
return OkHttpClient.Builder()
|
||||
.addNetworkInterceptor { chain ->
|
||||
|
@ -26,7 +28,7 @@ class Api {
|
|||
return Retrofit.Builder()
|
||||
.client(okHttpClient)
|
||||
.baseUrl(LobstersApi.BASE_URL)
|
||||
.addConverterFactory(Json.asConverterFactory(contentType))
|
||||
.addConverterFactory(json.asConverterFactory(contentType))
|
||||
.build()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue