Browse Source

Remove pk from Caption constructor, to resolve deserialization exception when pk sent by api is a string

renovate/org.robolectric-robolectric-4.x
Ammar Githam 4 years ago
parent
commit
0986f2fb71
  1. 4
      app/src/main/java/awais/instagrabber/repositories/responses/Caption.kt
  2. 1
      app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java

4
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
data class Caption(val userId: Long, var text: String?) : Serializable {
var pk: Long = 0
}

1
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 : ""
);

Loading…
Cancel
Save