twilio / twilio-oai

The Twilio OpenAPI Specification
MIT License
123 stars 78 forks source link

Incorrect type for `latitude` and `longitude` fields #45

Open dansimau opened 3 years ago

dansimau commented 3 years ago

According to the docs here: https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource

The latitude and longitude fields are strings, e.g.:

[...]
      "latitude": "19.720000",
[...]
      "longitude": "-155.090000",

However, the OpenAPI spec specifies them as type number: https://raw.githubusercontent.com/twilio/twilio-oai/main/spec/json/twilio_api_v2010.json

[...]
          "latitude": {
            "description": "The latitude of this phone number's location",
            "nullable": true,
            "type": "number"
          },
[...]
          "longitude": {
            "description": "The longitude of this phone number's location",
            "nullable": true,
            "type": "number"
          },
[...]

I think this might be what's causing errors in the Go SDK, e.g. in twilio-go:

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

See: https://github.com/twilio/twilio-go/issues/120

twilio-dx commented 3 years ago

Ahoy! Thank you for opening your first issue here! If this request is regarding troubleshooting your application, please reach out to the support team via https://support.twilio.com.

JenniferMah commented 3 years ago

Hi @dansimau! Thanks for bringing this to our attention! 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. Internal Reference

nickdelja commented 2 years ago

Hey @JenniferMah , Do you have any updates on this issue? I see see it is labeled as "help wanted", but it seems like it needs an internal fix.

KevinZhou1 commented 2 years ago

+1 on this issue. I can't use the go sdk without it :(

javapro108 commented 2 years ago

Hello,

Please can you update on this issue or any timeline for the fix?

Thanks!