I'm having issue with restql parsing filter queries when some filters allow comma separated values, specifically ordering filters where multiple fields can be ordered by, e.g. /api/employees/?query=(ordering:last_name,first_name){*}
The error response I get is:
[
"QuerySyntaxError: expecting '{' on (ordering:last_name,"
]
I don't get the error if I only order by one field. Also, if I attempt to chain the ordering, e.g. /api/employees/?query=(ordering:last_name,ordering:first_name){*}, I get the result that it only orders by the last ordering element (by first_name). It doesn't do the hierarchical ordering that I desire.
The filter backend I'm using is django-filter (link to its OrderingFilter doc), though I doubt it's relevant because django's built-in ordering filter also supports CSV values.
I know the bug happens here but I'm no pypeg2 expert. I'm guessing one potential fix is to maybe change the delimiter to |, e.g. query=(ordering:field1,field2|filter2:field3|filter3:fieldX|...){*}?
I'm having issue with restql parsing filter queries when some filters allow comma separated values, specifically ordering filters where multiple fields can be ordered by, e.g.
/api/employees/?query=(ordering:last_name,first_name){*}
The error response I get is:
I don't get the error if I only order by one field. Also, if I attempt to chain the ordering, e.g.
/api/employees/?query=(ordering:last_name,ordering:first_name){*}
, I get the result that it only orders by the last ordering element (byfirst_name
). It doesn't do the hierarchical ordering that I desire.The filter backend I'm using is django-filter (link to its OrderingFilter doc), though I doubt it's relevant because django's built-in ordering filter also supports CSV values.
I know the bug happens here but I'm no pypeg2 expert. I'm guessing one potential fix is to maybe change the delimiter to
|
, e.g.query=(ordering:field1,field2|filter2:field3|filter3:fieldX|...){*}
?