-
-
Notifications
You must be signed in to change notification settings - Fork 956
Description
I have created some related issues at api-platform/api-platform repo, but there are fewer people watching that repo, I created here. this issue is very important, I hope to raise our community notice.
Why I think it is a issue?
when an entity is used for admin user, it is dereferencable, but when it is used for customer, it might not. api-platform gives me lots of troubles because of this design.
Case 1: dereferencable for admin, not for customer.
for example , a Order entity has a property car, the car property is also an entity. when car entity is used for admin, it is dereferencable, but it is not for customer. the car entity is only showed when customer views order details, it is not necessary to add an item operation to car for customer.
Case 2: change get item operation
let's assume the Order entity has another property payment, payment is dereferencable for admin and customer, which means, for admin, the get item operation path is /api/admin/payment/{id} , for customer, it is /api/shop/payment/{id}, then when we try to serialize the Order for customer, how can we choose the get item operation for customer , not the admin one?
Related issues
How to disable a single itemOperation
don't force use to specify item route for an entity