Skip to content

Commit

Permalink
Merge pull request #2524 from soyuka/merging
Browse files Browse the repository at this point in the history
Merging #1906 #2000
  • Loading branch information
soyuka committed Feb 15, 2019
2 parents d96b52a + a508fec commit d2b1b96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Expand Up @@ -126,7 +126,7 @@ private function apply(bool $collection, QueryBuilder $queryBuilder, QueryNameGe
private function joinRelations(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, bool $forceEager, bool $fetchPartial, string $parentAlias, array $options = [], array $normalizationContext = [], bool $wasLeftJoin = false, int &$joinCount = 0, int $currentDepth = null)
{
if ($joinCount > $this->maxJoins) {
throw new RuntimeException('The total number of joined relations has exceeded the specified maximum. Raise the limit if necessary, or use the "max_depth" option of the Symfony serializer.');
throw new RuntimeException('The total number of joined relations has exceeded the specified maximum. Raise the limit if necessary with the "api_platform.eager_loading.max_joins" configuration key (https://api-platform.com/docs/core/performance/#eager-loading), or limit the maximum serialization depth using the "enable_max_depth" option of the Symfony serializer (https://symfony.com/doc/current/components/serializer.html#handling-serialization-depth).');
}

$currentDepth = $currentDepth > 0 ? $currentDepth - 1 : $currentDepth;
Expand Down
Expand Up @@ -134,11 +134,11 @@ public function load(array $configs, ContainerBuilder $container)
$this->registerOAuthConfiguration($container, $config);
$this->registerApiKeysConfiguration($container, $config);
$this->registerSwaggerConfiguration($container, $config, $loader);
$this->registerJsonApiConfiguration($formats, $loader);
$this->registerJsonLdConfiguration($container, $formats, $loader, $config['enable_docs']);
$this->registerGraphqlConfiguration($container, $config, $loader);
$this->registerJsonHalConfiguration($formats, $loader);
$this->registerJsonProblemConfiguration($errorFormats, $loader);
$this->registerGraphqlConfiguration($container, $config, $loader);
$this->registerJsonApiConfiguration($formats, $loader);
$this->registerBundlesConfiguration($bundles, $config, $loader);
$this->registerCacheConfiguration($container);
$this->registerDoctrineConfiguration($container, $config, $loader, $useDoctrine);
Expand Down
Expand Up @@ -330,7 +330,7 @@ public function testDenormalizeItemWithExistingGroups()
public function testMaxJoinsReached()
{
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('The total number of joined relations has exceeded the specified maximum. Raise the limit if necessary, or use the "max_depth" option of the Symfony serializer.');
$this->expectExceptionMessage('The total number of joined relations has exceeded the specified maximum. Raise the limit if necessary with the "api_platform.eager_loading.max_joins" configuration key (https://api-platform.com/docs/core/performance/#eager-loading), or limit the maximum serialization depth using the "enable_max_depth" option of the Symfony serializer (https://symfony.com/doc/current/components/serializer.html#handling-serialization-depth).');

$resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataFactoryInterface::class);
$resourceMetadataFactoryProphecy->create(Dummy::class)->willReturn(new ResourceMetadata());
Expand Down

0 comments on commit d2b1b96

Please sign in to comment.