-
-
Notifications
You must be signed in to change notification settings - Fork 587
Max depth produces array of nulls #671
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
Comments
for arrays you need max_depth = 2 |
Thanks for responding so quickly but if I set max_depth = 2 then that just pushes the problem further down:
Now I get the full set of tags for the lineManager but I also get their lineManager and they have an array of nulls for tags. |
it is a known bug (and very old), but you can put max_depth = 2 on your collections |
Forgive me if I am misunderstanding but does this mean I should have max_depth = 1 on the line manager property and max_depth = 2 on tags? That doesn't seem to affect anything for me. I'm also wondering why the behaviour has recently changed if it was an old bug? |
this is a old bug, if you look at the issue list, there are issues 2 years old talking about it Fixing the bug now will almost create a BC break, since a lot of people (me includes) are solving the issue with max depth = 2 |
OK I'm going to work around the problem. Thanks for your help. |
Since updating from v1.3.x to 1.4.x the serializer now returns an array of nulls when max_depth is exceeded whereas before it returned an empty array.
E.g. I have something like this set up:
In my serializer config I have max_depth set to 1 for $lineManager.
I used to get something like this when serializing a user:
Now I get this:
lineManager.tags has gone from [] to [null, null, null]
I've had a look through the notes etc. and I can't see anything about this. It's possible that it was intended but it doesn't seem right to me.
The text was updated successfully, but these errors were encountered: