zalando / restful-api-guidelines

A model set of guidelines for RESTful APIs and Events, created by Zalando
https://opensource.zalando.com/restful-api-guidelines/
Creative Commons Attribution 4.0 International
2.61k stars 384 forks source link

Remove sort example from simple query language (236) #804

Closed ePaul closed 4 months ago

ePaul commented 4 months ago

The sort=id:desc example doesn't fit the "equality comparison for a logical property".

It also leads to confusion on how to indicate how the result should be sorted (rule 137 says sort=-id).

This replaces it with another "logical property", the age (which is often calculated from the birthday and current date).

(Triggered by an internal chat message.)

rishiraj88 commented 4 months ago

For sort order, 'asc' and 'dec' may make good sense. I am not sure whether we are curious about 'desc' to mean "decreasing". Is it a case here?

ePaul commented 4 months ago

@rishiraj88

For sort order, 'asc' and 'dec' may make good sense. I am not sure whether we are curious about 'desc' to mean "decreasing". Is it a case here?

desc (for "descending") might make sense, but it doesn't fit into the query language rule (as it's not a filter – unless you are querying a list of queries or similar), and it also contradicts the earlier rule 137 about the + or - prefix (and we want to be consistent).

tfrauenstein commented 4 months ago

👍

tkrop commented 4 months ago

👍