|
49 | 49 | use ApiPlatform\Hydra\Serializer\CollectionNormalizer as HydraCollectionNormalizer; |
50 | 50 | use ApiPlatform\Hydra\Serializer\DocumentationNormalizer as HydraDocumentationNormalizer; |
51 | 51 | use ApiPlatform\Hydra\Serializer\EntrypointNormalizer as HydraEntrypointNormalizer; |
| 52 | +use ApiPlatform\Hydra\Serializer\PartialCollectionViewNormalizer as HydraPartialCollectionViewNormalizer; |
52 | 53 | use ApiPlatform\Hydra\State\HydraLinkProcessor; |
53 | 54 | use ApiPlatform\JsonApi\JsonSchema\SchemaFactory as JsonApiSchemaFactory; |
54 | 55 | use ApiPlatform\JsonApi\Serializer\CollectionNormalizer as JsonApiCollectionNormalizer; |
@@ -734,13 +735,19 @@ public function register(): void |
734 | 735 | ); |
735 | 736 | }); |
736 | 737 |
|
737 | | - $this->app->singleton(HydraCollectionNormalizer::class, function (Application $app) use ($defaultContext) { |
738 | | - return new HydraCollectionNormalizer( |
739 | | - $app->make(ContextBuilderInterface::class), |
740 | | - $app->make(ResourceClassResolverInterface::class), |
741 | | - $app->make(IriConverterInterface::class), |
| 738 | + $this->app->singleton(HydraPartialCollectionViewNormalizer::class, function (Application $app) use ($defaultContext) { |
| 739 | + return new HydraPartialCollectionViewNormalizer( |
| 740 | + new HydraCollectionNormalizer( |
| 741 | + $app->make(ContextBuilderInterface::class), |
| 742 | + $app->make(ResourceClassResolverInterface::class), |
| 743 | + $app->make(IriConverterInterface::class), |
| 744 | + $app->make(ResourceMetadataCollectionFactoryInterface::class), |
| 745 | + $defaultContext |
| 746 | + ), |
| 747 | + 'page', |
| 748 | + 'pagination', |
742 | 749 | $app->make(ResourceMetadataCollectionFactoryInterface::class), |
743 | | - $defaultContext |
| 750 | + $app->make(PropertyAccessorInterface::class), |
744 | 751 | ); |
745 | 752 | }); |
746 | 753 |
|
@@ -845,7 +852,7 @@ public function register(): void |
845 | 852 | $config = $app['config']; |
846 | 853 | $list = new \SplPriorityQueue(); |
847 | 854 | $list->insert($app->make(HydraEntrypointNormalizer::class), -800); |
848 | | - $list->insert($app->make(HydraCollectionNormalizer::class), -800); |
| 855 | + $list->insert($app->make(HydraPartialCollectionViewNormalizer::class), -800); |
849 | 856 | $list->insert($app->make(JsonLdItemNormalizer::class), -890); |
850 | 857 | $list->insert($app->make(JsonLdObjectNormalizer::class), -995); |
851 | 858 | $list->insert($app->make(ArrayDenormalizer::class), -990); |
|
0 commit comments