From 0986f2fb71408b2db50e29b010837154bc0c4271 Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Sun, 23 May 2021 12:09:54 +0900 Subject: [PATCH] Remove pk from Caption constructor, to resolve deserialization exception when pk sent by api is a string --- .../java/awais/instagrabber/repositories/responses/Caption.kt | 4 +++- .../main/java/awais/instagrabber/utils/ResponseBodyUtils.java | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/repositories/responses/Caption.kt b/app/src/main/java/awais/instagrabber/repositories/responses/Caption.kt index 9b69c113..eebc6655 100644 --- a/app/src/main/java/awais/instagrabber/repositories/responses/Caption.kt +++ b/app/src/main/java/awais/instagrabber/repositories/responses/Caption.kt @@ -2,4 +2,6 @@ package awais.instagrabber.repositories.responses import java.io.Serializable -data class Caption(var pk: Long = 0, val userId: Long, var text: String) : Serializable \ No newline at end of file +data class Caption(val userId: Long, var text: String?) : Serializable { + var pk: Long = 0 +} \ No newline at end of file diff --git a/app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java b/app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java index 5f7adf21..e4fb5101 100644 --- a/app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java +++ b/app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java @@ -781,7 +781,6 @@ public final class ResponseBodyUtils { ); } final Caption caption = new Caption( - 0, userId, captionText != null ? captionText : "" );