all: allow unknown keys in responses

This commit is contained in:
Harsh Shandilya 2021-12-15 16:10:41 +05:30
parent b5c2dc9aaf
commit 6eb3acff78
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80
3 changed files with 12 additions and 3 deletions

View file

@ -27,11 +27,12 @@ class LobstersApiTest {
private val contentType = "application/json".toMediaType()
private val webServer = MockWebServer()
private val okHttp = OkHttpClient.Builder().build()
private val json = Json { ignoreUnknownKeys = true }
private val retrofit =
Retrofit.Builder()
.client(okHttp)
.baseUrl("http://localhost:8080/")
.addConverterFactory(Json.asConverterFactory(contentType))
.addConverterFactory(json.asConverterFactory(contentType))
.build()
private val apiClient = retrofit.create<LobstersApi>()