@@ -973,11 +973,7 @@ public function register(): void
973973 );
974974 });
975975
976- $ this ->app ->bind (SerializerInterface::class, Serializer::class);
977- $ this ->app ->bind (NormalizerInterface::class, Serializer::class);
978- $ this ->app ->singleton (Serializer::class, function (Application $ app ) {
979- /** @var ConfigRepository */
980- $ config = $ app ['config ' ];
976+ $ this ->app ->singleton ('api_platform_normalizer_list ' , function (Application $ app ) {
981977 $ list = new \SplPriorityQueue ();
982978 $ list ->insert ($ app ->make (HydraEntrypointNormalizer::class), -800 );
983979 $ list ->insert ($ app ->make (HydraPartialCollectionViewNormalizer::class), -800 );
@@ -1011,14 +1007,20 @@ public function register(): void
10111007 $ list ->insert ($ app ->make (GraphQlRuntimeExceptionNormalizer::class), -780 );
10121008 }
10131009
1010+ return $ list ;
1011+ });
1012+
1013+ $ this ->app ->bind (SerializerInterface::class, Serializer::class);
1014+ $ this ->app ->bind (NormalizerInterface::class, Serializer::class);
1015+ $ this ->app ->singleton (Serializer::class, function (Application $ app ) {
10141016 // TODO: unused + implement hal/jsonapi ?
10151017 // $list->insert($dataUriNormalizer, -920);
10161018 // $list->insert($unwrappingDenormalizer, 1000);
10171019 // $list->insert($jsonserializableNormalizer, -900);
10181020 // $list->insert($uuidDenormalizer, -895); //Todo ramsey uuid support ?
10191021
10201022 return new Serializer (
1021- iterator_to_array ($ list ),
1023+ iterator_to_array ($ app -> make ( ' api_platform_normalizer_list ' ) ),
10221024 [
10231025 new JsonEncoder ('json ' ),
10241026 $ app ->make (JsonEncoder::class),
0 commit comments