Skip to content

[Serializer] Docs for the @MaxDepth annotation #7039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 14, 2016
Merged

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Oct 6, 2016

public $foo;

// ...
}
Copy link

@snoek09 snoek09 Oct 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent php code block.

),
),
);
*/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add missing .. code-block:: php-annotations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, just .. code-block:: php

@wouterj wouterj added this to the 3.1 milestone Nov 9, 2016
Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 a useful feature explained in a clear and concise way. Thanks @dunglas.

@lyrixx
Copy link
Member

lyrixx commented Dec 7, 2016

@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 ...)

@javiereguiluz
Copy link
Member

@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!

@digilist
Copy link

digilist commented Dec 12, 2016

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:

    '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).

@xabbuh
Copy link
Member

xabbuh commented Dec 14, 2016

Thank you Kévin.

@xabbuh xabbuh merged commit d7395d3 into symfony:3.1 Dec 14, 2016
xabbuh added a commit that referenced this pull request Dec 14, 2016
…, 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
@xabbuh
Copy link
Member

xabbuh commented Dec 14, 2016

@digilist I think best is if you could open an issue on the code repository containing the necessary code to reproduce your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants