-
-
Notifications
You must be signed in to change notification settings - Fork 903
The total number of joined relations has exceeded the specified maximum #1910
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
There's a relation joining recursivity.
@ApiResource(attributes={"normalization_context": {"groups"={"todolist"}, "enable_max_depth"=true}}) |
@soyuka , thank you for your fast reply! Can you provide me with an example, please? I've tried to use I've enabled the annotations for Serializer in |
Ok, I'm doing other tests, but without success. TEST 1: Disable First, I tried to disable the
and
FAILED: The error is still there. TEST 2: Disable eager loading for all resources As suggested by @dunglas in #876 (comment) and described in the documentation here, I added this to my api_platform:
mapping:
paths: ['%kernel.project_dir%/src/Entity']
eager_loading:
force_eager: false SOLVED: This solved the problem, but opened another one. THE CURRENT PROBLEM Using So, my question is: is this behavior intended? Is it possible that if one uses TEST 3: As suggested by @soyuka in api-platform/api-platform#187 (comment) (and also in a previous comment in this issue too ), I did this:
This worked too! CONCLUSIONS So, my suggestion is to create a troubleshooting section in the documentation where this issue is addressed and the solutions I tried here are better described: I spent a lot of time figuring out how to solve the issue! Anyway, thank you @soyuka and @dunglas for the suggestione you leave in the issues: reading with more calm and deeper, I was able to finally solve the issue! |
How did you solve this issue? can you give me idea? :) |
work for me 👍
|
work without "force_eager"=false TOO |
I have two entities, one representing a
Todo
and one representing a
TodoList
:A
Todo
is obviously associated to aTodoList
and I need that when I fetch a Todo, I get also some details of theTodoList
.But this configuration doesn't permit me to create new
Todo
s as I receive this error:I'm trying with a payload like this:
Nothing complex: just the name of the
Todo
and theTodoList
in which it is.I've tried to add
"put"={"normalization_context"={"groups"={"put"}}}
to theitemOperations
but this didn't solved my problem.Any ideas of how I can solve this problem?
I need that the
TodoList
is embedded in the response I receive for a singleTodo
and, obviously, I want to be able to also create newTodo
s.Thank you!
PS
The api documentation is telling me that the payload should be something like this:
So I think that there is something wrong with the configuration of the embedding...
The text was updated successfully, but these errors were encountered: