netbox-community / go-netbox

The official Go API client for Netbox IPAM and DCIM service.
Other
192 stars 141 forks source link

Call to Get Ip-addresses panics on unmarshal error #133

Closed Hakura77 closed 1 year ago

Hakura77 commented 2 years ago

The data structure for an Ip Address AssignedObject (currently map[string]*string) causes a panic on un-marshalling

Currently the return type from the API itself can be a mix of String, Int64 and in the case of the Device field another map

Looking at the swagger.json, this can be fixed by changing the definition there's additional properties to type "object" instead of type "string"

I've done so in a fork and regenerated the client, which fixes the issue, but I'm unsure if this is the policy with issues in the swagger.json generally?

Thanks

v0ctor commented 1 year ago

Fixed in Netbox 3.3.2.