added support for comments in the API rules and filter expressions

This commit is contained in:
Gani Georgiev
2023-12-02 16:37:04 +02:00
parent aaab643629
commit d3713a9d7c
40 changed files with 130 additions and 105 deletions
+7
View File
@@ -69,6 +69,13 @@ func (f FilterData) BuildExpr(
}
data, err := fexpr.Parse(raw)
if err != nil {
// depending on the users demand we may allow empty expressions
// (aka. expressions consisting only of whitespaces or comments)
// but for now disallow them as it seems unnecessary
// if errors.Is(err, fexpr.ErrEmpty) {
// return dbx.NewExp("1=1"), nil
// }
return nil, err
}
// store in cache