API Platform version(s) affected: 2.6.3
Description
The defaults.order config value, which would work as the global equivalent of https://api-platform.com/docs/core/default-order/#overriding-default-order (fields array), is also used in place of collection.order (direction string), which causes a TypeError.
How to reproduce
Config:
api_platform:
defaults:
order: [createdAt, id]
Error (on collection GET request):
Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\OrderExtension::__construct() must be of the type string or null, array given
Possible Solution
Revert the order-related changes of dc461fc (note that, unlike the collection.pagination.* non-*_parameter_name keys, collection.order is not deprecated, so I don't see the reason for wanting to move it to defaults.order, even more so since that key was already used after #3151)
Additional Context
Workaround for now: use the explicit attributes sublevel:
api_platform:
defaults:
attributes:
order: [createdAt, id]
API Platform version(s) affected: 2.6.3
Description
The
defaults.orderconfig value, which would work as the global equivalent of https://api-platform.com/docs/core/default-order/#overriding-default-order (fields array), is also used in place ofcollection.order(direction string), which causes a TypeError.How to reproduce
Config:
Error (on collection GET request):
Possible Solution
Revert the order-related changes of dc461fc (note that, unlike the
collection.pagination.*non-*_parameter_namekeys,collection.orderis not deprecated, so I don't see the reason for wanting to move it todefaults.order, even more so since that key was already used after #3151)Additional Context
Workaround for now: use the explicit
attributessublevel: