我尝试返回一个带有所有_links的超媒体对象,并且我仅获得“自我”值。
谁可以设置更新,放置,删除链接?
我在配置中设置了“ format:jsonhal:['application / hal + json']”。设置accessControl,...我想我还不明白^^'
template = 'UUID_GENERATE_V4()'
api_platform.yaml
{
"_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"
}
]
}
}
modules.php(实体)
api_platform:
formats:
jsonhal: ['application/hal+json']
json: ['application/json']
html: ['text/html']
mapping:
paths: ['%kernel.project_dir%/src/Entity']
Api模式 ApiSchemaScreen