I try to return an Hypermedia Object (with all _links) and i get only 'self' value.
Who can i set Update, Put, Delete links ?
I've set " formats: jsonhal: ['application/hal+json']" in my config. Set accessControl,... i think i've not understand somthing ^^'
{
"_links": {
"self": {
"href": "/api/modules"
},
"item": [
{
"href": "/api/modules/1"
},
{
"href": "/api/modules/2"
}
]
},
"totalItems": 2,
"itemsPerPage": 30,
"_embedded": {
"item": [
{
"_links": {
"self": {
"href": "/api/modules/1"
}
},
"id": 1,
"title": "Module Premier",
"description": "Description Premier Admin"
},
{
"_links": {
"self": {
"href": "/api/modules/2"
}
},
"id": 2,
"title": "Deuxieme Modules",
"description": "Description du deuxieme module"
}
]
}
}
api_platform.yaml
api_platform:
formats:
jsonhal: ['application/hal+json']
json: ['application/json']
html: ['text/html']
mapping:
paths: ['%kernel.project_dir%/src/Entity']
modules.php(Entity)
* @ApiResource()
* @ORM\Entity(repositoryClass="App\Repository\ModulesRepository")
*/
class Modules
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=233)
*/
private $title;
...
Api schema ApiSchemaScreen