You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the ordering can be provided in two ways:
?orderBy=shortCode: This allows defining the filed to sort by. The direction is assumed to be ASC
?orderBy[shortCode]=DESC: This allows defining both the field and the direction, being the field a key and the direction a value, once PHP parses the query params.
This approach has one benefit. PHP parses both of them out of the box, but it has two problems:
The value has to be treated as string|array, forcing checks in order to know how the value was provided.
The second approach is not 100% standard http, which makes you have to URL-encode the values, like this ?orderBy%5BshortCode%5D=DESC.
In order to simplify that, the two supported values should be these:
?orderBy=shortCode
?orderBy=shortCode-DESC (using a hyphen or some other character to separate the field name from the direction).
This would be standard HTTP, and would also be simpler to parse, as we can always consider it a string which needs to be exploded, being the second param optional and falling back to ASC.
Currently, the ordering can be provided in two ways:
?orderBy=shortCode
: This allows defining the filed to sort by. The direction is assumed to beASC
?orderBy[shortCode]=DESC
: This allows defining both the field and the direction, being the field a key and the direction a value, once PHP parses the query params.This approach has one benefit. PHP parses both of them out of the box, but it has two problems:
string|array
, forcing checks in order to know how the value was provided.?orderBy%5BshortCode%5D=DESC
.In order to simplify that, the two supported values should be these:
?orderBy=shortCode
?orderBy=shortCode-DESC
(using a hyphen or some other character to separate the field name from the direction).This would be standard HTTP, and would also be simpler to parse, as we can always consider it a string which needs to be exploded, being the second param optional and falling back to
ASC
.The
orderBy[shortCode]=DESC
approach will be considered deprecated, removed from docs, and removed from Shlink by v3.0.0The text was updated successfully, but these errors were encountered: