Skip to content
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

Merging #1906 #2000 #2524

Merged
merged 2 commits into from
Feb 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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