Closed Ntr0 closed 2 years ago
Right, but I think that the fix needs to be in MarshalJson function where the fields are checked against nil before serialisation. Even though protocol is immutable for updates, it's also required for Post, which is why it doesn't have omitEmpty(for POST it can't be absent).
For MarshalJson protocol will keep being not serialised if it is sent as nil.
Fixed in V6.0.1
omitempty
. The description says this field is disallowed in update requestsomitempty
, as setting null explicitly resets this certain property, e.g. Updating SourceIP from "10.10.10.1/32" tonull
will change the rule to allow ingress from all SourceIPs. This is not possible if these values are not produced when marshalling to json.