diff --git a/sarif/result.go b/sarif/result.go index 34ae8a6..201efd0 100644 --- a/sarif/result.go +++ b/sarif/result.go @@ -30,8 +30,9 @@ type Result struct { WorkItemUris []string `json:"workItemUris,omitempty"` // can be null HostedViewerUri *string `json:"hostedViewerUri,omitempty"` // Provenance *resultProvenance `json:"provenance,omitempty"` - Fixes []*Fix `json:"fixes,omitempty"` - OccurrenceCount *uint `json:"occurrenceCount,omitempty"` + Fixes []*Fix `json:"fixes,omitempty"` + OccurrenceCount *uint `json:"occurrenceCount,omitempty"` + Properties Properties `json:"properties,omitempty"` } func newRuleResult(ruleID string) *Result { @@ -141,3 +142,14 @@ func (r *Result) WithOccurrenceCount(occurrenceCount int) *Result { r.OccurrenceCount = &count return r } + +// WithProperties specifies properties for a rule and returns the updated rule +func (r *Result) WithProperties(properties Properties) *Result { + r.Properties = properties + return r +} + +// AttachPropertyBag adds a property bag to a rule +func (r *Result) AttachPropertyBag(pb *PropertyBag) { + r.Properties = pb.Properties +}