Just wondering if I am able to use API platform to handle the following table structure.
--------------
- id - auto increment - primary key
- uuid - string
- name
- department_id
--------------
- id - auto increment - primary key
- uuid - string
- name
I would like to use api platform to achieve the following with ApiSubresource:
GET /api/student/{uuid}
Response
{
"uuid": "a1590004-f74b-4a10-93f0-27f17c370058",
"name": "student1",
"department": "/api/department/a2122004-f74b-4a10-93f0-27f17c370058"
}
Thanks.
it's a custom route not a subresource
I do something similar.
Try annotating your ID with @ApiProperty(identifier=false) and the uuid with @ApiProperty(identifier=true)
Thanks @bendavies . Your approach is working.
Most helpful comment
I do something similar.
Try annotating your ID with
@ApiProperty(identifier=false)and the uuid with@ApiProperty(identifier=true)