Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

The NumberInsightClient.Standard call returns an unmarshal error when the roaming field is 'unknown' #73

Open
panyushov opened this issue Mar 8, 2022 · 0 comments

Comments

@panyushov
Copy link

panyushov commented Mar 8, 2022

Whenever I call the standard number insight on an Italian number

auth := vonage.CreateAuthFromKeySecret("*****", "*******")
niClient := vonage.NewNumberInsightClient(auth)

result, _, err := niClient.Standard("39**********", vonage.NiOpts{})
if err != nil {
    ...
}

I'm getting a json: cannot unmarshal string into Go struct field NiResponseJsonStandard.roaming of type numberinsight.NiRoaming error since the roaming field in the return JSON is of type string with value unknown that cannot be unmarshalled into the NiRoaming struct.

{
    "status": 0,
    "status_message": "Success",
    "request_id": "4edb629f-114b-401b-8871-29710867ca5d",
    "country_code": "IT",
    "country_code_iso3": "ITA",
    "country_name": "Italy",
    "country_prefix": "39",
    ...
    "ported": "ported",
    "roaming": "unknown"
}

Here's decode that causes the issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant