MCPcopy Create free account
hub / github.com/compose-spec/compose-go / getMostSpecificError

Function getMostSpecificError

schema/schema.go:151–163  ·  view source on GitHub ↗
(err *jsonschema.ValidationError)

Source from the content-addressed store, hash-verified

149}
150
151func 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
165func specificity(err *jsonschema.ValidationError) int {
166 if err == nil {

Callers 1

ValidateFunction · 0.85

Calls 1

specificityFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…