-
-
Notifications
You must be signed in to change notification settings - Fork 932
Description
API Platform version(s) affected: 4.1.21
Description
When using QueryParameter in a Laravel env, I've found an incoherence in how properties names are handled.
In a model with an is_active fillable :
#[QueryParameter(key: 'sort[:property]', filter: OrderFilter::class)]
: this will allow me to sort by isActive written in camelCase like so sort[isActive]=desc
#[QueryParameter(key: 'sort[:property]', filter: OrderFilter::class, properties: ['id', 'title', 'isActive', 'createdAt'])]
and #[QueryParameter(key: 'sort[isActive]', filter: OrderFilter::class)]
however will not, returning this error instead : SQLSTATE[42S22]: Column not found: 1054 Unknown column '' in 'ORDER BY' (Connection: mysql, SQL: select * from `proof_missions` where `proof_missions`.`deleted_at` is null order by `` asc limit 10 offset 0
Additional Context
Might be related to #7344