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:
parent
c57de75dac
commit
0760901d6e
1 changed files with 8 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue