From 503ee704984a86a8f186eda47a850080d2a81a9a Mon Sep 17 00:00:00 2001 From: Aleksei Iakovlev Date: Tue, 21 Mar 2023 21:12:02 +0800 Subject: [PATCH] omitempty for rules weight --- rules/rules.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules/rules.go b/rules/rules.go index 63a5664..3b41b6b 100644 --- a/rules/rules.go +++ b/rules/rules.go @@ -18,7 +18,7 @@ type CreateRequest struct { Rule string `json:"rule,omitempty"` RuleType int `json:"ruleType"` OriginGroup *int `json:"originGroup"` - Weight int `json:"weight"` + Weight int `json:"weight,omitempty"` OverrideOriginProtocol *string `json:"overrideOriginProtocol"` Options *gcore.Options `json:"options,omitempty"` } @@ -27,7 +27,7 @@ type UpdateRequest struct { Name string `json:"name,omitempty"` Rule string `json:"rule,omitempty"` RuleType int `json:"ruleType"` - Weight int `json:"weight"` + Weight int `json:"weight,omitempty"` OriginGroup *int `json:"originGroup"` OverrideOriginProtocol *string `json:"overrideOriginProtocol"` Options *gcore.Options `json:"options,omitempty"`