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

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

Open
derTuca opened this issue Feb 1, 2025 · 0 comments

Comments

@derTuca
Copy link

derTuca commented Feb 1, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant