From 0760901d6ece2b0ea723ede76889765f9dd721a8 Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Mon, 31 Jan 2022 14:17:35 +0100 Subject: [PATCH] Fixed issue #37 --- csaf/validation.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/csaf/validation.go b/csaf/validation.go index f171234..c22906a 100644 --- a/csaf/validation.go +++ b/csaf/validation.go @@ -121,9 +121,15 @@ func (cs *compiledSchema) validate(doc interface{}) ([]string, error) { res := make([]string, 0, len(errs)) for i := range errs { - if e := &errs[i]; e.InstanceLocation != "" && e.Error != "" { - res = append(res, e.InstanceLocation+": "+e.Error) + e := &errs[i] + if e.Error == "" { + continue } + loc := e.InstanceLocation + if loc == "" { + loc = e.AbsoluteKeywordLocation + } + res = append(res, loc+": "+e.Error) } return res, nil