-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Description
| Q | A |
|---|---|
| Bug report? | yes |
| Feature request? | no |
| BC Break report? | no |
| RFC? | no |
| Symfony version | 3.1.7 |
I tested the new MaxDepth annotation in the Symfony serializer (see #17113). Consider some code that extends the example code given in the pull request with more levels (4, 5, etc.). By keeping a max depth of 2, the result is the following:
'foo' => 'level1',
'child' =>
array (
'foo' => 'level2',
'child' =>
array (
'child' =>
array (
'child' =>
array (
'child' =>
array (
'child' => NULL,
),
),
),
),
),
)As you can see, it considers all child nodes and does not stop after the configured max depths. Only the data of the objects in deeper levels is excluded (attribute foo).