netbox-community / go-netbox

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

Setting Geo Coordinates to 0 or nil #162

Closed haipersuccor02 closed 6 months ago

haipersuccor02 commented 8 months ago

I have pushed an MR weeks ago to removed the omitempty property to the Latitude and Longitude. It passed the unit test. MRs : go-netbox terraform-provider-netbox

But after some more testing and investigation on our local netbox, we stumbled with the following logs:

Screenshot 2023-10-25 at 6 16 43 PM

Something in the upstream is updating the nil value to the previous value.

And we found this series of code

This codes are confusing but seems to us that it is setting the site parameters such as latitude and longitude and not allowing it to be nil or empty.

Please kindly enlighten us to what this codes trying to do and why. Are we not allowed to set the latitude and longitude 0.

Thank you :)

v0ctor commented 6 months ago

A new alpha version has been released with a different software to generate the library, so hopefully this bug has been resolved.

Please feel free to test it and to provide feedback.