Skip to content

Commit

Permalink
Optional property (#232)
Browse files Browse the repository at this point in the history
* optional property

* use omitempty as optional
  • Loading branch information
TomK authored Dec 13, 2024
1 parent 2788c2e commit 64c0b86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion v1/policy/rate_limit.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const (

type RateLimitPolicy struct {
// LimitProperty is the property to limit the rate by, global if empty
LimitProperty RateLimitKey `json:"limitProperty" yaml:"limitProperty" validate:"oneof=PlacementID MerchantReference CorrelationID BillingProfileID IP Currency UserAgent DeviceType DeviceBrowser DeviceBrowserVersion DeviceFingerprint"`
LimitProperty RateLimitKey `json:"limitProperty" yaml:"limitProperty" validate:"omitempty,oneof=PlacementID MerchantReference CorrelationID BillingProfileID IP Currency UserAgent DeviceType DeviceBrowser DeviceBrowserVersion DeviceFingerprint"`
// IPOptions allows for additional rate limiting options for IP based rate limits
IPOptions *RateLimitIPOptions `json:"ipOptions" yaml:"ipOptions" validate:"required_if=LimitProperty IP"`
// HardLimit is the maximum number of requests allowed in the window
Expand Down

0 comments on commit 64c0b86

Please sign in to comment.