launchdarkly / api-client-go

LaunchDarkly API Client for Go
Other
8 stars 12 forks source link

Rule.variation is required #9

Closed szechyjs closed 1 year ago

szechyjs commented 2 years ago

When creating a patch that includes a Rule the marshalled result fails to include Variation if its value is 0 due to omitempty.

https://github.com/launchdarkly/api-client-go/blob/master/model_rule.go#L21

This was the first instance of this that I came across, but I'm sure there are other required fields that get omitted with zero values.

InTheCloudDan commented 2 years ago

Hi @szechyjs do you happen to have a minimal reproducible sample of code for it? The Rule struct is a pointer to an int32 so even if it's 0 it should be getting marshalled.

sloloris commented 1 year ago

Going to go ahead and close this issue as it is quite old - if this problem persists, or you encounter any others, please file a new one!