Skip to content

[Bug] Invalid types in last update #1076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
codygordon opened this issue Mar 11, 2025 · 9 comments · May be fixed by #1090
Open

[Bug] Invalid types in last update #1076

codygordon opened this issue Mar 11, 2025 · 9 comments · May be fixed by #1090
Labels
priority: high Needs immediate attention; blockers or critical or bug type: bug bug in the library

Comments

@codygordon
Copy link

codygordon commented Mar 11, 2025

Some of the changes in the following commit define types don't match the actual structure of the data causing type errors when attempting to access values as documented.

For example, lineTypeIntelligence: Record<string, object> suggests that the shape would be:

lineTypeIntelligence: {
   key: { ... }
}

It should probably instead be Record<string, any>.

Or, even better, it should contain the actual available keys and value types as documented.

49f3f2b#diff-55a60b51b684465835a0448f6efceb0ef9b0cb5ada598728e1594ebf2507deddR292

@msheakoski
Copy link

I also see an issue in src/rest/bulkexports/v1/export/job.ts:

49f3f2b#diff-5a4d9d347825dc80283179a0537726bed59c467114fdbefac69d0b4d73329a0bR409

This type should be Record<string, any>[] because the API returns the following structure for job.details:

[
  {
    status: 'Submitted',
    count: 3,
    days: [ '2025-03-07', '2025-03-08', '2025-03-09' ]
  }
]

@msheakoski
Copy link

The same invalid types remain as of v5.5.2

@danny-fairly
Copy link

I'm also seeing an issue with broken types as a result of this commit: 49f3f2b

The issue I'm encountering is similar to the one @codygordon posted but on ParticipantInstance.

Old type prior to v.5.5.0: messaging_binding: any;
Broken type introduced in v5.50: messaging_binding: Record<string, object>;
Expected type: messaging_binding: Record<string, string>; or messaging_binding: Record<string, any>;

@tiwarishubham635 tiwarishubham635 added type: bug bug in the library priority: high Needs immediate attention; blockers or critical or bug labels Apr 16, 2025
@dmitriy-kudelko
Copy link

Same here. A few erroneous types were introduced including:

  • DocumentInstance.data: Record<string, object>;
  • FlexFlowInstance.integration: Record<string, object>;

@manisha1997
Copy link
Contributor

Hello! Thanks for raising the issue. We will look at it on priority basis.

@jswirbs
Copy link

jswirbs commented May 5, 2025

Hi, we are experiencing a similar issue with the types field on the SubscriptionListInstanceCreateOptions interface, which was updated from Array<any> to Array<object> type. Now when trying to create a subscription, we get the following error Error: Input list of Types cannot be empty.

We have reverted our twilio client version back to 5.2.2, before this change, and things are working as expected, but it would be great to get this fixed, assuming this is indeed the root issue here.

@mindiweik
Copy link

mindiweik commented May 9, 2025

We experienced the same issue: Input list of Types cannot be empty above. We reverted to version 5.4.5 and I noticed the same change noted above, appearing to be the culprit.

It looks like the provided objects are no longer stringified using (e: any) => serialize.object(e) as they were before. (See serialize.object() functionality)

@tiwarishubham635
Copy link
Contributor

Hi! So as these helpers are autogenerated from the public open api specs, due to a recent update these changes have been introduced. I see the best way in most of the above cases would be to use Record<string, any>. In case of encryption_details, where the expected datatype should be Record<string, any>[], I'll check with the product team to update the spec accordingly so that we can generate them correctly. I'll raise a PR to preview these changes and once finalized, they should be available in the next release. Thanks!

@tiwarishubham635 tiwarishubham635 linked a pull request May 20, 2025 that will close this issue
8 tasks
@tiwarishubham635
Copy link
Contributor

Please review #1090 and let me know if there are any issues. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high Needs immediate attention; blockers or critical or bug type: bug bug in the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants