You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# src/Entity/User.phpnamespaceApp\Entity;
useApp\Mapping\UserMapProvider;
useAutoMapper\Attribute\MapProvider;
#[MapProvider(provider: UserMapProvider::class)]
class User
Throws the exception Provider with id "App\\Mapping\\UserMapProvider" not found.. Manually supplying the provider to Automapper::create() works successfully, but when using the AutoMapperInterface from Symfony's dependency injection fails even when registering the map provider as a public service.
The documentation states that "When using the Symfony Bundle version of the AutoMapper, the provider will be the service id, which may be different from the class name" but the service id is correct:
$ bin/console debug:container App\\Mapping\\UserMapProvider
Information for Service "App\Mapping\UserMapProvider"
=====================================================
---------------- -----------------------------
Option Value
---------------- -----------------------------
Service ID App\Mapping\UserMapProvider
Class App\Mapping\UserMapProvider
The text was updated successfully, but these errors were encountered:
subiabre
changed the title
Provider with id existing service id not found.
Provider with existing service id not found.
Nov 28, 2024
Providers are not being correctly registered using the Symfony Bundle version of the AutoMapper under release 9.2 in Symfony 6.
Implementing the following mapper:
Throws the exception
Provider with id "App\\Mapping\\UserMapProvider" not found.
. Manually supplying the provider toAutomapper::create()
works successfully, but when using theAutoMapperInterface
from Symfony's dependency injection fails even when registering the map provider as a public service.The documentation states that "When using the Symfony Bundle version of the AutoMapper, the provider will be the service id, which may be different from the class name" but the service id is correct:
The text was updated successfully, but these errors were encountered: