docs icon indicating copy to clipboard operation
docs copied to clipboard

Documentation states that exposing a model to OpenAPI without any routes can use non-existing controllers

Open derTuca opened this issue 9 months ago • 1 comments

In this section, the following is written: This way, we expose a route that will do… nothing. Note that the controller does not even need to exist.

However, if a non-existing controller is used, Symfony returns the following error:

Operation "_api_/entity_name{._format}_get" is defining an unknown service as controller "App\Entity\NonExistingControllerForOpenApi". Make sure it is properly registered in the dependency injection container in . (which is being imported from "/app/config/routes/api_platform.yaml"). Make sure there is a loader supporting the "api_platform" type.

Creating an empty AbstractController and referencing that fixes the issue.

derTuca avatar Feb 01 '25 11:02 derTuca

Indeed it's an error in our documentation but as you don't need controllers with API Platform we should probably just remove that.

soyuka avatar Feb 12 '25 08:02 soyuka

Solved by #2197

vinceAmstoutz avatar Sep 08 '25 09:09 vinceAmstoutz