I am trying to create a simple web app using Symfony 5. I am using the API.
Currently when calling some endpoint it only displays the IRI link to the related link:

I need instead to display the related entity object itself; if I get the Item endpoint the related entity Program should be returned this:
{
"id": 1,
"program": {
"id": 1,
"name": "First program"
},
"description": "fgdfg",
"comment": "dfgdfg"
{
So, this is how the table looks:

I thought setting up a subresource would be enough to get the object but it wasn't:
In the
InventoryItementity configured@ApiSubresourceannotation of theProgramproperty:/** * @ORM\ManyToOne(targetEntity=Program::class, inversedBy="inventoryItems") * @ORM\JoinColumn(nullable=false) * @ApiSubresource */ private $program;In
resources.yamlfile I configured the subresource:App\Entity\InventoryItem: properties: program: subresource: resourceClass: 'App\Entity\Program' collection: true
This still returns the IRI instead of the object, The only thing that has changed was that now I can access to the related entity for the current object in this URL: http://localhost:8000/api/inventory_items/1/program.json.
Any idea on how to return the related entity object itself instead of the IRI URL?