twilio-java icon indicating copy to clipboard operation
twilio-java copied to clipboard

Latest Twilio Java SDK breaks Job endpoint

Open ukby1234 opened this issue 1 year ago • 6 comments

Issue Summary

Job.fetcher(jobSid).fetch failed with the exceptions posted.

Steps to Reproduce

  1. This is the first step
  2. This is the second step
  3. Further steps, etc.

Code Snippet

Job.fetcher(jobSid).fetch

Exception/Log

Exception in thread "main" com.twilio.exception.ApiException: Cannot deserialize value of type `java.util.LinkedHashMap<java.lang.String,java.lang.Object>` from Array value (token `JsonToken.START_ARRAY`)
 at [Source: (ByteArrayInputStream); line: 1, column: 348] (through reference chain: com.twilio.rest.bulkexports.v1.export.Job["details"])
	at com.twilio.rest.bulkexports.v1.export.Job.fromJson(Job.java:84)
	at com.twilio.rest.bulkexports.v1.export.JobFetcher.fetch(JobFetcher.java:61)
	at com.twilio.rest.bulkexports.v1.export.JobFetcher.fetch(JobFetcher.java:30)
	at com.twilio.base.Fetcher.fetch(Fetcher.java:40)

Technical details:

  • twilio-java version: 9.6.2
  • java version: 11

ukby1234 avatar Jun 09 '23 22:06 ukby1234

HI @ukby1234 , Thanks for reaching out and pointing out the issue, we have been able to reproduce it. Will inform once the fix is available.

kridai avatar Jun 12 '23 12:06 kridai

@kridai any updates on this bug?

ukby1234 avatar Jul 11 '23 20:07 ukby1234

@ukby1234 I am actively working on the fix of above issue. Will be updating soon.

sbansla avatar Oct 11 '23 10:10 sbansla

@ukby1234 I tried calling the API using Postman, and it turns out that the 'details' should be an array of hashmaps instead of a single hashmap. This appears to be a bug in how the API specifications are declared, which is why the SDK is currently using it as a hashmap. I will work to rectify this issue internally and will inform you once it is resolved.

sbansla avatar Oct 11 '23 11:10 sbansla

I have again reminded the concerned team.

sbansla avatar Jan 17 '24 06:01 sbansla

@sbansla any updates on this issue?

ukby1234 avatar Aug 09 '24 07:08 ukby1234