-
-
Notifications
You must be signed in to change notification settings - Fork 892
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
[api-platform/core: v2.4.3] [BUG] Binary UUID in search filter returns an empty array #2838
Comments
Do you have an idea on how we could fix this? Should we add the identifier conversion on collections? |
Yeah. That's what I was thinking. We should be able to fix this when the ReadListener is processing the filters and saving it into the context. After parsing the filters from |
This'd be very welcome |
…platform#2838". Fixed by adding support for custom types in the ORM SearchFilter.
All done @soyuka . CaveatThe fix is only for ORM. I didn't have the time to look at ODM SearchFilter. Let me know there's anything else needed. Thanks. Update: Found a simpler way to do it without changing service definition. |
This bug is targeting 2.7, as API Platform 3.2 is out, version 2.7 has reached end of life. Therefore we'll close this issue. We recommend to upgrade to API Platform 3.0, Les-Tilleuls.coop can offer paid support to help or even migrate your projects if they have tests. We want to fund a Long Term Stable version of API Platform, if you or your organization would like to contribute to LTS support, please visit our Open Collective crowdfunding. |
This issue was raised as a comment in this issue here, but since that issue is labeled
won't fix
I am not sure if my comment will be ignored, so creating a new issue here.The Entity
doctrine.yaml
Search filter
Because the id is exact, we can filter on multiple ids in a single query.
The API Resource file
The bug
When visiting the route
/users/{id}
, where id is a UUID v1, everything works.When visiting the route
/users?id[0]={id}
the system returns an empty array since its not converting the string UUIDs to Ramsey UUID objects.It was cited in a comment here that the actual bug is this one. So I added the following in class
Ramsey\Uuid\Doctrine\UuidBinaryOrderedTimeType
But the UUID is still not converted.
For item operations, it works fine since in the identifiers are converted here. But for collection operations, the id filter is not converted.
Regarding the solution provided here I have reservations mentioned in this comment here.
Please let me know if you need any more details. Thanks.
The text was updated successfully, but these errors were encountered: