1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 05:40:11 +01:00

Make extraction of fields optional

This commit is contained in:
Sascha L. Teichmann 2022-05-10 16:38:34 +02:00
parent 41e4029b0d
commit d6c0fa3518
2 changed files with 22 additions and 7 deletions

View file

@ -51,8 +51,8 @@ func NewAdvisorySummary(
{Expr: titleExpr, Action: util.StringMatcher(&e.Title)},
{Expr: currentReleaseDateExpr, Action: util.TimeMatcher(&e.CurrentReleaseDate, time.RFC3339)},
{Expr: initialReleaseDateExpr, Action: util.TimeMatcher(&e.InitialReleaseDate, time.RFC3339)},
{Expr: summaryExpr, Action: util.StringMatcher(&e.Summary)},
{Expr: tlpLabelExpr, Action: util.StringMatcher(&e.TLPLabel)},
{Expr: summaryExpr, Action: util.StringMatcher(&e.Summary), Optional: true},
{Expr: tlpLabelExpr, Action: util.StringMatcher(&e.TLPLabel), Optional: true},
{Expr: publisherExpr, Action: util.ReMarshalMatcher(e.Publisher)},
}, doc); err != nil {
return nil, err