diff --git a/src/Symfony/Bundle/Resources/config/api.php b/src/Symfony/Bundle/Resources/config/api.php index 817be1aa96..91f8ce1d40 100644 --- a/src/Symfony/Bundle/Resources/config/api.php +++ b/src/Symfony/Bundle/Resources/config/api.php @@ -252,7 +252,8 @@ ->tag('routing.loader'); $services->set('api_platform.symfony.iri_converter.skolem', SkolemIriConverter::class) - ->args([service('api_platform.router')]); + ->args([service('api_platform.router')]) + ->tag('kernel.reset', ['method' => 'reset']); $services->set('api_platform.api.identifiers_extractor', IdentifiersExtractor::class) ->args([ diff --git a/src/Symfony/Tests/Bundle/DependencyInjection/ApiPlatformExtensionTest.php b/src/Symfony/Tests/Bundle/DependencyInjection/ApiPlatformExtensionTest.php index 0f3fe8a609..c9f737cb68 100644 --- a/src/Symfony/Tests/Bundle/DependencyInjection/ApiPlatformExtensionTest.php +++ b/src/Symfony/Tests/Bundle/DependencyInjection/ApiPlatformExtensionTest.php @@ -202,6 +202,17 @@ public function testObjectMapperDoesNotLoadDeprecatedTranslationCommand(): void self::assertFalse(class_exists(FrameworkTranslationExtractCommand::class, false)); } + public function testSkolemIriConverterIsResetBetweenRequests(): void + { + (new ApiPlatformExtension())->load(self::DEFAULT_CONFIG, $this->container); + + $this->assertServiceHasTags('api_platform.symfony.iri_converter.skolem', ['kernel.reset']); + $this->assertSame( + [['method' => 'reset']], + $this->container->getDefinition('api_platform.symfony.iri_converter.skolem')->getTag('kernel.reset'), + ); + } + public function testCommonConfiguration(): void { $config = self::DEFAULT_CONFIG;