Nelmioapidocbundle: Symfony 4 don't load services.xml

Created on 22 Dec 2017  路  11Comments  路  Source: nelmio/NelmioApiDocBundle

Hi i'm install this bundle and in example.com/api/ url get LogicException with message Controller not found: service "nelmio_api_doc.controller.swagger_ui" does not exist.

I think symfony cannot load services.xml inside bundle, but why? Or i make something wrong?

Most helpful comment

The swagger_ui controller requires both twig & symfony/asset which are not mentioned in the doc and are not added by the flex recipe.

If those are missing, the service nelmio_api_doc.controller.swagger_ui will not be autowired and therefor won't be found (regardless of it being public).

All 11 comments

services are private by default now, so this controller should be explicitly marked as public

@scaytrase not sure what you mean, it is already explicitely made public.

@GuilhemN hm, indeed

@za4me did you enabled bundle in kernel?

duplicate of #1143 - there is no recipe for flex yet.

any workaround?

@Gemorroj not to use flex for this bundle?

Hi guys. Sorry i'm later, but i remove all packages and install this and it working fine. I forgot the exact solution, but like last time, I did not add the code in routing.yml.

@dbu Thank a lot, now i need fix my another bundle for using new nelmio :D

The swagger_ui controller requires both twig & symfony/asset which are not mentioned in the doc and are not added by the flex recipe.

If those are missing, the service nelmio_api_doc.controller.swagger_ui will not be autowired and therefor won't be found (regardless of it being public).

are not added by the flex recipe

This is not possible afaik. We mention it in the routing of the recipe though.

which are not mentioned in the doc

Please submit a PR if you think it's lacking.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BraisGabin picture BraisGabin  路  7Comments

DavidGarciaCat picture DavidGarciaCat  路  4Comments

BafS picture BafS  路  3Comments

kojidev picture kojidev  路  6Comments

ajaypatelbardoli picture ajaypatelbardoli  路  6Comments