Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BC Break on SearchFilter with date as input #4128

@Nek-

Description

@Nek-

API Platform version(s) affected: x.y.z

Description

If you use dates with the search filter, this was supported, it now triggers an exception. This is because previously the type was not always sent with the doctrine parameter, and doctrine was considering the date as string type (which is valid when you have a string like 2021-01-12 as input).

How to reproduce

If you have the following filter configured on an entity, it will break:

/**
 * ...
 * @ApiFilter(SearchFilter::class, properties={"something.id": "exact", "date": "exact"})
 */

Possible Solution

Add support for dates, which is a special case that is not that simple because it requires to manage date, datetime, datetime_immutable and so on.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions