twilio / twilio-java

A Java library for communicating with the Twilio REST API and generating TwiML.
MIT License
482 stars 421 forks source link

Latest Twilio Java SDK breaks Job endpoint #748

Open ukby1234 opened 1 year ago

ukby1234 commented 1 year ago

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:

kridai commented 1 year ago

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.

ukby1234 commented 1 year ago

@kridai any updates on this bug?

sbansla commented 10 months ago

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

sbansla commented 10 months ago

@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 commented 7 months ago

I have again reminded the concerned team.

ukby1234 commented 2 weeks ago

@sbansla any updates on this issue?