1 package utils 2 3 import ( 4 "errors" 5 6 "github.com/qri-io/jsonschema" 7 ) 8 9 func GetSchemaError(errs []jsonschema.KeyError) error { 10 var errStr string 11 for _, err := range errs { 12 invalidValue := jsonschema.InvalidValueString(err.InvalidValue) 13 14 errStr = errStr + "Property: " + err.PropertyPath + " has invalid value of: " + invalidValue + "\n" 15 } 16 17 return errors.New(errStr) 18 } 19