(err *jsonschema.ValidationError)
| 149 | } |
| 150 | |
| 151 | func getMostSpecificError(err *jsonschema.ValidationError) *jsonschema.ValidationError { |
| 152 | var mostSpecificError *jsonschema.ValidationError |
| 153 | if len(err.Causes) == 0 { |
| 154 | return err |
| 155 | } |
| 156 | for _, cause := range err.Causes { |
| 157 | cause = getMostSpecificError(cause) |
| 158 | if specificity(cause) > specificity(mostSpecificError) { |
| 159 | mostSpecificError = cause |
| 160 | } |
| 161 | } |
| 162 | return mostSpecificError |
| 163 | } |
| 164 | |
| 165 | func specificity(err *jsonschema.ValidationError) int { |
| 166 | if err == nil { |
no test coverage detected
searching dependent graphs…