elasticpath/epcc-search-ast-helper

Sort allowed list of fields

Closed this issue · 0 comments

When returning an error for an invalid field, it returns a list of allowed fields, but these are not sorted. This means that any tests using that specific error message can fail as the expected order is not always the order you get.

return false, fmt.Errorf("unknown field [%s] specified in search filter, allowed fields are %v", requestField, reflect.ValueOf(v.AllowedOperators).MapKeys())