twilio / twilio-go

A Go package for communicating with the Twilio API.
MIT License
278 stars 40 forks source link

ApiV2010AvailablePhoneNumberLocal latitude and longitud fields incorrectly mapped as float #120

Closed leangl closed 2 years ago

leangl commented 2 years ago

Issue Summary

Getting the following error when calling *ApiV2010.ListAvailablePhoneNumberLocal(CountryCode string, params ListAvailablePhoneNumberLocalParams)**

cannot unmarshal string into Go struct field ApiV2010AvailablePhoneNumberLocal.available_phone_numbers.latitude of type float32

Steps to Reproduce

  1. call ListAvailablePhoneNumberLocal operation
  2. see error returned

Code Snippet

c.twilioRestClient.ApiV2010.ListAvailablePhoneNumberLocal("US", &openapi2.ListAvailablePhoneNumberLocalParams{
        SmsEnabled:   aws.Bool(true),
        MmsEnabled:   aws.Bool(true),
        VoiceEnabled: aws.Bool(true),
        PageSize:     &amount,
        Limit:        &amount,
    })

Exception/Log


cannot unmarshal string into Go struct field ApiV2010AvailablePhoneNumberLocal.available_phone_numbers.latitude of type float32```

### Technical details:
* twilio-go version: 0.14.2
* go version: 1.16
eshanholtz commented 2 years ago

This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

patnunes commented 2 years ago

Hello! I have this same issue with a similar endpoint.

Issue Summary

Getting the following error when calling *ApiV2010AvailablePhoneNumberMobile(CountryCode string, params ListAvailablePhoneNumberMobileParams)

error: json: cannot unmarshal string into Go struct field ApiV2010AvailablePhoneNumberMobile.available_phone_numbers.latitude of type float32

Steps to Reproduce

  1. call ListAvailablePhoneNumberMobile operation

  2. see error returned

Code Snippet

responseMobile, errTwilio := s.subAccountClient.ApiV2010.ListAvailablePhoneNumberMobile( countryCode, &openapiaccount.ListAvailablePhoneNumberMobileParams{PathAccountSid: &accountSid, SmsEnabled: &availableSms})

javapro108 commented 2 years ago

Hello,

I am also facing the same issue. Is there any update or any expected timeline for the fix?

Looking forward for quick solution on this issue.

Thanks!

usab2binfo commented 2 years ago

Hi Team, we are having similar challenge with local numbers. This bug is a show stopper for us to continue forward. Please help us.

Hope this will be resolved quickly in coming days.

childish-sambino commented 2 years ago

PR linked to resolve this issue.