netbox-community / go-netbox

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

Cannot set MarkUtilized to false when doing IpamPrefixesPartialUpdate #152

Closed ArnoSen closed 10 months ago

ArnoSen commented 1 year ago

The problem is caused by a combination of variable type and json tags in models.WritablePrefix:

       MarkUtilized bool `json:"mark_utilized,omitempty"`

The 'omitempty' triggers that the default value for bool which is false is omitted from the JSON. I think the best solution is that MarkUtilized becomes a pointer variable. I do not know how this can be easily changes in the OpenAPI definition.

v0ctor commented 10 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.