Skip to content

Introduce a @Depth annotation #104

@dunglas

Description

@dunglas

When serializing trees with groups such as the following, it is convenient to be able to configure the Serialization depth:

class TreeEntry
{
    /**
      * @var TreeEntry
      * @Groups{"a"}
      */
    public $parent;
}

A new @Depth(n) where N is the maximum depth level to normalize can be useful for such use case. When n is reached, the normalizer will output the IRI of the resource instead of embedding it. Proposal:

class TreeEntry
{
    /**
      * @var TreeEntry
      * @Groups{"a"}
      * @Depth(2)
      */
    public $parent;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions