Skip to content
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

Support vor netbox v3.3? #136

Closed
christophbrejla opened this issue Oct 14, 2022 · 7 comments
Closed

Support vor netbox v3.3? #136

christophbrejla opened this issue Oct 14, 2022 · 7 comments

Comments

@christophbrejla
Copy link

Hello, we are using netbox version v3.3.4 at this point. I tried to use the netbox client with release "netbox_v3.2" and the prerelease "netbox_v3.4". I am facing several incompatibility issues.

json: cannot unmarshal number 35.0 into Go struct field DeviceWithConfigContext.results.position of type int64 json: cannot unmarshal number into Go struct field IPAddress.results.assigned_object of type string cannot unmarshal array into Go struct field IPAddress.results.nat_outside of type models.NestedIPAddress

There are also several unmarshalling problems where referenced objects cannot be unmarshalled to the type "map[string]*string". if its changed to "map[string]any" then its working.

are you planning to release a compatible version vor version 3.3. any time soon?

maybe you can consider the changes i made in my fork and merge them

christophbrejla/go-netbox@master...feature/netbox_v3.3

@vwbusguy
Copy link

vwbusguy commented Nov 7, 2022

I can replicate this with v3.3.6 on both the v3.2 and v3.4 versions. For example, getting a device list returns:

FATA[0000] Cannot get devices list: json: cannot unmarshal number 24.0 into Go struct field DeviceWithConfigContext.results.position of type int64 
exit status 1

@vwbusguy
Copy link

vwbusguy commented Nov 7, 2022

I used replace ( in the go.mod to use your fork instead and it's working for me so far!

@vwbusguy
Copy link

vwbusguy commented Nov 7, 2022

I didn't see a PR for yours but it looks like someone else submitted a PR in the meantime: #137

@tao-sj
Copy link

tao-sj commented Nov 14, 2022

this issue can be closed - I've verified #137 fixed it.

@christophbrejla
Copy link
Author

Hello, i have tested the lastest version from "master" branch. i am still getting errors when calling "dcim.NewDcimConsolePortsListParams()", for example

cannot unmarshal object into Go struct field ConsolePort.results.link_peers of type string

in the current implementation this property is

LinkPeers []*string json:"link_peers"``

and earlier (when it worked) it was

LinkPeer map[string]*string json:"link_peer,omitempty"``

Is there some kind of config for the serializer to make this work? how come others dont have those serialization problems?

Thank you

@tao-sj
Copy link

tao-sj commented Dec 2, 2022

Hello, i have tested the lastest version from "master" branch. i am still getting errors when calling "dcim.NewDcimConsolePortsListParams()", for example

cannot unmarshal object into Go struct field ConsolePort.results.link_peers of type string

in the current implementation this property is

LinkPeers []*string json:"link_peers"``

and earlier (when it worked) it was

LinkPeer map[string]*string json:"link_peer,omitempty"``

Is there some kind of config for the serializer to make this work? how come others dont have those serialization problems?

Thank you

I didn't try this one.

@v0ctor
Copy link
Collaborator

v0ctor commented Feb 25, 2023

Support added by release v3.3.10-0.

@v0ctor v0ctor closed this as completed Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants