You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
I use custom resource. In custom resource use stateOption with my entity ORM. If use "id" as identifier so everything works well. On one resource need slug as identifier. So i use ApiProperty and set identifiers. Using default ItemProvider. It can find result without problems. If i dump result in ItemProvider so i can see my result. Problem is in "Unable to generate an IRI for the item of type "App\ApiResource\PageContentApi"", which si crashing in IriConvertor.php line 169.
ApiResource
Entity
How to reproduce
Simple create custom resource with stateOption to entity. Use native ItemProvider. Change identifier. (In doc see correct slug to uri variable) and run request.
Possible Solution
In IdentifiersExtractor.php method getIdentifiersFromItem() line 51-53. If item is not resource class so there is hardcoded property "id" which get "id" from entity. BUT there should be "slug" i need identifier from apiResource not default ID. If i this part comment (yes comment :D for try what will happen) so its jump next and get correct identifier from operation which is set in custom api resource. And it generate correct uri with ../{slug}
Additional Context
Plese fix it.. this is annoying. I love apiPlatform... I think this should work native. Change identifier in custom resource with stateOption. Thanks !!
The text was updated successfully, but these errors were encountered:
API Platform version(s) affected: 4.0.3
Description
I use custom resource. In custom resource use stateOption with my entity ORM. If use "id" as identifier so everything works well. On one resource need slug as identifier. So i use ApiProperty and set identifiers. Using default ItemProvider. It can find result without problems. If i dump result in ItemProvider so i can see my result. Problem is in "Unable to generate an IRI for the item of type "App\ApiResource\PageContentApi"", which si crashing in IriConvertor.php line 169.
ApiResource
Entity
How to reproduce
Simple create custom resource with stateOption to entity. Use native ItemProvider. Change identifier. (In doc see correct slug to uri variable) and run request.
Possible Solution
In IdentifiersExtractor.php method getIdentifiersFromItem() line 51-53. If item is not resource class so there is hardcoded property "id" which get "id" from entity. BUT there should be "slug" i need identifier from apiResource not default ID. If i this part comment (yes comment :D for try what will happen) so its jump next and get correct identifier from operation which is set in custom api resource. And it generate correct uri with ../{slug}
Additional Context
Plese fix it.. this is annoying. I love apiPlatform... I think this should work native. Change identifier in custom resource with stateOption. Thanks !!
The text was updated successfully, but these errors were encountered: