netbox-community / go-netbox

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

Several fields have number as type in swagger.json #33

Closed hensoko closed 4 years ago

hensoko commented 6 years ago

Hi,

I recently noticed that several properties in the swagger.json have the type number where I expected integer. This is especially the case for several ID properties like device_id in operation dcim_interfaces_list.

Is there a special reason for this?

I also noticed that several _id fields have string as type when being used as query param.

redsux commented 5 years ago

Hi,

It also concern other types, i found an issue with the Interface struct.

netbox/models/interface.go field IsConnected is define as a string but we got a bool from the JSON.

So go-netbox failed to unmarshal it correctly : cannot unmarshal bool into Go struct field Interface.is_connected of type string.