You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having a bool field with omitempty struct tag may cause incorrect behavior for updates.
In short:
If type bool value has omitempty, then having its value as false will not be unmarshaled to XML/JSON and will not be sent in API query.
If the SDK is used for updating settings and had true previously, then the update with false may have no impact on actual settings because field will be skipped in XML/JSON representation after unmarshaling.
This must be clarified and checked for values which are bool type and have omitempty tag.
There are quite a few such fields as it can be checked with: grep -Rn "bool" types/v56/types.go | grep omitempty
Update. It looks as skipping a field with false value is a problem in proxied NSX API only so far as was proven in #217 (comment)
The text was updated successfully, but these errors were encountered:
Having a
bool
field withomitempty
struct tag may cause incorrect behavior for updates.In short:
If the SDK is used for updating settings and had
true
previously, then the update withfalse
may have no impact on actual settings because field will be skipped in XML/JSON representation after unmarshaling.This must be clarified and checked for values which are
bool
type and haveomitempty
tag.There are quite a few such fields as it can be checked with:
grep -Rn "bool" types/v56/types.go | grep omitempty
Update. It looks as skipping a field with
false
value is a problem in proxied NSX API only so far as was proven in #217 (comment)The text was updated successfully, but these errors were encountered: