Skip to content

Networking v2 Extensions Networkipavailabilities cannot unmarshal into a *big.Int #2233

@alexeymyltsev

Description

@alexeymyltsev

If create big IPv6 subnet and try to collect information about available ips rise exception:
math/big: cannot unmarshal "4.722366482869645e+21" into a *big.Int

It happens because resopnse from networkipavailabilities.List() decoded to json and field "total_ips": 4722366482869645213694 decoded as total_ips:4.722366482869645e+21

allPagesNetworkIPAvailabilities, err := networkipavailabilities.List(client, networkipavailabilities.ListOpts{}).AllPages()
if err != nil {
  fmt.Println(err)
}

After that if we try to extract pages like that:

_, err = networkipavailabilities.ExtractNetworkIPAvailabilities(allPagesNetworkIPAvailabilities)
if err != nil {
  fmt.Println(err)
}

we will have exception
math/big: cannot unmarshal "4.722366482869645e+21" into a *big.Int

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions