-
-
Notifications
You must be signed in to change notification settings - Fork 925
Closed
Labels
Description
Hello !
I've got an entity with a tree :
/**
* @ApiResource(
* itemOperations={
* "get"={"method"="GET", "normalization_context"={"groups"={"read"}}},
* }
* )
*/
class Comment {
/**
* @var string
* @Groups({"read"})
*/
private $title;
/**
* @var Comment
* @Groups({"read"})
*/
private $parent;
}
I'd like to have the IRI parent, not the content.
The problem here is that I get :
{
"title": "My first post",
"parent": {
"title": "My second post"
}
}
instead of :
{
"title": "My first post",
"parent": "/posts/2"
}
I know that there is the @MaxDepth
annotation, but it doesn't generate IRI. Is there another solution ?