[Serializer] Docs for the @MaxDepth annotation#7039
Conversation
| public $foo; | ||
|
|
||
| // ... | ||
| } |
| ), | ||
| ), | ||
| ); | ||
| */ |
There was a problem hiding this comment.
Add missing .. code-block:: php-annotations.
There was a problem hiding this comment.
Actually, just .. code-block:: php
javiereguiluz
left a comment
There was a problem hiding this comment.
👍 a useful feature explained in a clear and concise way. Thanks @dunglas.
|
@javiereguiluz Hello. I was playing with the serializer and I did not find the doc on symfony.com. You added your 👍 15 days ago. I think we can merge this one to be able to deploy this new documentation? (It's available since symfony 3.1 ...) |
|
@lyrixx you are so right!! But before merging PRs in Symfony Docs, we need two 👍 from maintainers. So we need that @weaverryan or @xabbuh or @wouterj vote on this too. Thanks! |
|
I have a question regarding the max depth. I am not sure if this is desired behavior or a bug. If its the former, we should document this. If its the latter, we should fix the bug (I think it's a bug, but I wanted to ask you before opening an issue). Consider some code that extends your example code with more levels (4, 5, etc.). By keeping a max depth of 2, the result is the following: 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). |
|
Thank you Kévin. |
…, javiereguiluz) This PR was merged into the 3.1 branch. Discussion ---------- [Serializer] Docs for the @MaxDepth annotation Docs for symfony/symfony#17113. Commits ------- d7395d3 Make lines shorter to comply with our soft limit of 80 chars per line 93dcc3f Fix comments 97f48e5 [Serializer] Docs for the @MaxDepth annotation
|
@digilist I think best is if you could open an issue on the code repository containing the necessary code to reproduce your issue. |
Docs for symfony/symfony#17113.