Skip to content

Commit ccd14b8

Browse files
Add @JSON fields to the API error
1 parent b0b3570 commit ccd14b8

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

stream-android-core/src/main/java/io/getstream/android/core/api/model/exceptions/StreamEndpointErrorData.kt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package io.getstream.android.core.api.model.exceptions
1717

18+
import com.squareup.moshi.Json
1819
import com.squareup.moshi.JsonClass
1920
import io.getstream.android.core.annotations.StreamCoreApi
2021

@@ -40,12 +41,12 @@ import io.getstream.android.core.annotations.StreamCoreApi
4041
@StreamCoreApi
4142
@JsonClass(generateAdapter = true)
4243
public data class StreamEndpointErrorData(
43-
val code: Int,
44-
val duration: String,
45-
val message: String,
46-
val moreInfo: String,
47-
val statusCode: Int,
48-
val details: List<Int>,
49-
val unrecoverable: Boolean? = null,
50-
val exceptionFields: Map<String, String>? = null,
44+
@Json(name = "code") val code: Int,
45+
@Json(name = "duration") val duration: String? = null,
46+
@Json(name = "message") val message: String? = null,
47+
@Json(name = "more_info") val moreInfo: String? = null,
48+
@Json(name = "StatusCode") val statusCode: Int? = null,
49+
@Json(name = "details") val details: List<Int>? = null,
50+
@Json(name = "unrecoverable") val unrecoverable: Boolean? = null,
51+
@Json(name = "exception_fields") val exceptionFields: Map<String, String>? = null,
5152
)

0 commit comments

Comments
 (0)