1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 18:15:42 +01:00

Fixed issue #37

This commit is contained in:
Sascha L. Teichmann 2022-01-31 14:17:35 +01:00
parent c57de75dac
commit 0760901d6e

View file

@ -121,9 +121,15 @@ func (cs *compiledSchema) validate(doc interface{}) ([]string, error) {
res := make([]string, 0, len(errs)) res := make([]string, 0, len(errs))
for i := range errs { for i := range errs {
if e := &errs[i]; e.InstanceLocation != "" && e.Error != "" { e := &errs[i]
res = append(res, e.InstanceLocation+": "+e.Error) if e.Error == "" {
continue
} }
loc := e.InstanceLocation
if loc == "" {
loc = e.AbsoluteKeywordLocation
}
res = append(res, loc+": "+e.Error)
} }
return res, nil return res, nil