File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -58,16 +58,14 @@ public function onKernelView(GetResponseForControllerResultEvent $event)
58
58
return ;
59
59
}
60
60
61
- if (null === $ context = $ request ->attributes ->get ('_api_normalization_context ' )) {
62
- $ context = $ this ->serializerContextBuilder ->createFromRequest ($ request , true , $ attributes );
63
- }
64
-
61
+ $ context = $ this ->serializerContextBuilder ->createFromRequest ($ request , true , $ attributes );
65
62
$ resources = new class () extends \ArrayObject {
66
63
public function serialize ()
67
64
{
68
65
}
69
66
};
70
67
$ context ['resources ' ] = &$ resources ;
68
+ $ request ->attributes ->set ('_api_normalization_context ' , $ context );
71
69
72
70
$ event ->setControllerResult ($ this ->serializer ->serialize ($ controllerResult , $ request ->getRequestFormat (), $ context ));
73
71
You can’t perform that action at this time.
0 commit comments