From ae96d959b20ea7de434f7569f074a357792aefff Mon Sep 17 00:00:00 2001 From: TargetLocked <32962687+TargetLocked@users.noreply.github.com> Date: Fri, 26 Jul 2024 23:16:40 +0800 Subject: [PATCH] fix: preserve `type` while unmarshalling RuleSet --- option/template.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/option/template.go b/option/template.go index 59f2940..d2a6735 100644 --- a/option/template.go +++ b/option/template.go @@ -113,7 +113,7 @@ func (r *RuleSet) UnmarshalJSON(content []byte) error { if r.Type == C.RuleSetTypeGitHub { return option.UnmarshallExcluded(content, (*_RuleSet)(r), &r.GitHubOptions) } else { - return option.UnmarshallExcluded(content, (*_RuleSet)(r), &r.DefaultOptions) + return json.UnmarshalDisallowUnknownFields(content, &r.DefaultOptions) } }