API Platform is just great. You can build your very configurable API with solid standards in a few minutes. However, if your project is based on DDD, it means that your Entity classes are probably outside the default src/Entity directory. And if you want to use the API Platform with such a case, then you’ll face that the bundle does not generate any route for your API resources even if you mark them with the ApiResource annotation or attribute. And if you want to debug what’s going on by visiting your api/docs route, then you’ll see the error below:
To fix this error, you need to register your custom directories like this:
After that, your resources will be available for the API Platform. Happy coding!