-
-
Notifications
You must be signed in to change notification settings - Fork 921
Fix initialization of the serialization context #1726
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
Fix initialization of the serialization context #1726
Conversation
Okay, it doesn't work in the case of deserialization... I'll investigate. |
I think we should fix this in the - $context['normalization_context'] = $this->serializerContextBuilder->createFromRequest($request, true, $attributes);
+ $context += $this->serializerContextBuilder->createFromRequest($request, true, $attributes); But it looks like a BC Break to remove this key, isn't it? WDYT @api-platform/core-team? |
+1 about the second option. I'm not sure that this context is exposed to the public, I mean isn't it an internal thing only? |
Huum, not really. It's exposed when you implement |
👍 for the second option. It's kinda internal and it has been introduced in 2.2. It's now or never... |
befd9ba
to
6b85e58
Compare
5d9fc1f
to
37a3b72
Compare
needs to target 2.2 as a bug fix then? |
Right, I missed this branch... |
37a3b72
to
eb12404
Compare
Thanks @meyerbaptiste |
According to
core/src/EventListener/ReadListener.php
Line 73 in fb7cc47
normalization_context
index of the context array. So, if we pass the whole context array to theEagerLoadingExtension::joinRelations()
method, we can't properly retrieve groups, max depth and attributes.