-
-
Notifications
You must be signed in to change notification settings - Fork 893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SortFilter and DateFilter are broken on Swagger UI site #6921
Comments
@ryanhowdy have you found a cure for this? Suffering all sorts of issues with this when running with Laravel. |
No, i don't think the swagger specs allow for these type of complicated params. |
They do allow this: core/src/Doctrine/Orm/Filter/DateFilter.php Lines 286 to 297 in a8d0c84
There must be a bug I'll investigate, transfering this issue to @jonericksonbkjg please open a new issue. |
Hi there, I can not reproduce, do you have fields on your model? https://github.com/api-platform/core/blob/main/src/Laravel/workbench/app/Models/Author.php |
API Platform version(s) affected: 4.0.6
Description
I'm using Laravel with the IsApiResource Trait for my example.
OrderFilter
new QueryParameter(key: 'sort[:property]', filter: OrderFilter::class)
will not work because on the swagger ui site you do not get the option to set which property you are sorting by, just an option to set 'asc' or 'desc'.DateFilter
new QueryParameter(key: 'created', filter: DateFilter::class, property: 'created_at')
does not work on the swagger ui site because all you get is a box to enter the date value. And whatever you put in there just gets turned intoKEY=INPUT
.So if I enter
[lte]=2024-07-10
it gets turned intocreated=[lte]=2024-07-10
when what I really need iscreate[lte]=2024-07-10
.How to reproduce
The text was updated successfully, but these errors were encountered: