Jonny
12/31/2019, 4:28 AMval gson = GsonBuilder()
.setLenient()
.excludeFieldsWithoutExposeAnnotation()
.create()
val jobAcceptRequest = gson.fromJson(body, JobAcceptRequest::class.java)
The json is this:
{
"Id": 44,
"SenderId": "5d2f80d3-9199-4017-a5df-1d669928a0af",
"JobId": 13
}
And the class:
class JobAcceptRequest {
@Expose(serialize = false)
var id: Int = 0
@Expose(serialize = false)
var senderId: String = ""
@Expose
var jobId: Int = 0
}
I've parsed pretty much the same thing before and it worked fine then. What's wrong here?...itnoles
12/31/2019, 4:48 AMJonny
12/31/2019, 5:01 AM