Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Serializer] Docs for the @MaxDepth annotation#7039

Merged
xabbuh merged 3 commits into
symfony:3.1from
dunglas:pr_17113
Dec 14, 2016
Merged

[Serializer] Docs for the @MaxDepth annotation#7039
xabbuh merged 3 commits into
symfony:3.1from
dunglas:pr_17113

Conversation

@dunglas
Copy link
Copy Markdown
Member

@dunglas dunglas commented Oct 6, 2016

Comment thread components/serializer.rst Outdated
public $foo;

// ...
}
Copy link
Copy Markdown

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

Comment thread components/serializer.rst
),
),
);
*/
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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