By default, Netbox's REST API sets User Token's write_enabled field to
true. This means that if the field is not set explicitly in the request,
Netbox would automatically set it to true.
This behavior results to an inconsistency if the value is set to false
and omitempty is configured in the JSON tag. This is because by default,
JSON Marshaller omits false booleans. Since the field is omitted,
Netbox REST API would default it to true. Hence, an inconsistency
would occur.
To fix this, simply remove the omitempty tag from the writable token.
By default, Netbox's REST API sets User Token's write_enabled field to true. This means that if the field is not set explicitly in the request, Netbox would automatically set it to true.
This behavior results to an inconsistency if the value is set to false and omitempty is configured in the JSON tag. This is because by default, JSON Marshaller omits false booleans. Since the field is omitted, Netbox REST API would default it to true. Hence, an inconsistency would occur.
To fix this, simply remove the omitempty tag from the writable token.
References: